Skip to content

refactor: use explicit TLS secret keys instead of map iteration - #346

Open
racciari wants to merge 1 commit into
caddyserver:mainfrom
racciari:fix/tls-secret-map-iteration-order
Open

racciari wants to merge 1 commit into
caddyserver:mainfrom
racciari:fix/tls-secret-map-iteration-order

Conversation

@racciari

@racciari racciari commented Feb 5, 2026

Copy link
Copy Markdown

Replace map iteration over Secret.Data with explicit access to the standard Kubernetes TLS secret keys (tls.crt, tls.key).

Benefits:

  • More explicit about expected secret structure
  • Follows Kubernetes TLS secret convention
  • Avoids including unexpected keys if secret contains extra data
  • Maintains conventional PEM order (certificate before key)

No functional change for standard TLS secrets.

Replace map iteration over Secret.Data with explicit access to
the standard Kubernetes TLS secret keys (tls.crt, tls.key).

Benefits:
- More explicit about expected secret structure
- Follows Kubernetes TLS secret convention
- Avoids including unexpected keys if secret contains extra data
- Maintains conventional PEM order (certificate before key)

No functional change for standard TLS secrets.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant