Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Challenge/HttpChallengeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,17 @@ private async Task AddChallengeHostsAsync(IEnumerable<string> hosts, Cancellatio
}
}

private static string GetPathType()
{
return Environment.GetEnvironmentVariable("KCERT_PATH_TYPE") ?? "Prefix";
Comment on lines +82 to +84
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Extract the default path type ("Prefix") into a shared constant or configuration field to avoid duplicating the literal and keep it in sync with the Helm chart default.

Suggested change
private static string GetPathType()
{
return Environment.GetEnvironmentVariable("KCERT_PATH_TYPE") ?? "Prefix";
private const string DefaultPathType = "Prefix";
private static string GetPathType()
{
return Environment.GetEnvironmentVariable("KCERT_PATH_TYPE") ?? DefaultPathType;

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider validating the environment variable against allowed Kubernetes PathType values (Prefix, Exact, ImplementationSpecific) to fail fast on invalid configuration.

Copilot uses AI. Check for mistakes.
}

private V1IngressRule CreateRule(string host)
{
var path = new V1HTTPIngressPath
{
Path = "/.well-known/acme-challenge/",
PathType = "Prefix",
PathType = GetPathType(),
Backend = new()
{
Service = new()
Expand Down
2 changes: 1 addition & 1 deletion charts/kcert/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: kcert
description: Deploys KCert for issuing Let's Encrypt certificates
version: 1.0.7
version: 1.0.8
appVersion: 1.2.0
maintainers:
- name: Nabeel Sulieman
Expand Down
2 changes: 2 additions & 0 deletions charts/kcert/templates/070-Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
- name: ACME__EMAIL
# Your email address for Let's Encrypt and email notifications
value: {{ required "acmeEmail is required" .Values.acmeEmail }}
- name: KCERT_PATH_TYPE
value: {{ .Values.kcertPathType | default "Prefix" | quote }}
{{- if .Values.smtp.secretName }}
- name: SMTP__EMAILFROM
valueFrom:
Expand Down
2 changes: 2 additions & 0 deletions charts/kcert/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ resources: {}

# Set this to false in order to generate a plain yaml template without the Helm custom labels
forHelm: true

kcertPathType: Prefix