Repository navigation
Read Traefik TLS material where Traefik reads it - #2075
Merged
Merged
Conversation
ServersTransportTCP keeps its TLS settings under spec.tls, but Radar read them from spec, so a TCP transport's CA and client certificates never appeared. Neither transport kind read rootCAs, which replaced the deprecated rootCAsSecrets and can name a ConfigMap. A TLSStore's extra certificates under spec.certificates were ignored too. The audit read the same wrong fields, so those Secrets and ConfigMaps could be reported as unused. Read them through one shared helper in both places. Stop drawing an IngressRoute's tls.store as configuration: Traefik serves every route from the default TLSStore and ignores a route's reference.
PR Summary by QodoRead Traefik TLS references from the fields Traefik uses
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Radar read Traefik's TLS references from the wrong fields. A ServersTransportTCP's CA and client certificates, and the CA ConfigMaps or Secrets a transport names under
rootCAs, never appeared in topology or the resource drawer. The audit reads the same fields, so it could report those Secrets and ConfigMaps as unused, which invites deleting live TLS material. Radar also drew an IngressRoute'stls.storeas configuration, although Traefik ignores it.What changed
One helper,
configrefs.TraefikTransportRefs, reads what Traefik reads; topology and the audit both use it:traefik.io):spec.rootCAs[](a Secret or a ConfigMap), the deprecatedspec.rootCAsSecrets, andspec.certificatesSecrets.spec.tls. Radar read them fromspec, where the TCP kind has none.rootCAsentry that names both a Secret and a ConfigMap is skipped, as Traefik's provider does.spec.certificates[].secretNameas well asspec.defaultCertificate, throughconfigrefs.TraefikTLSStoreSecrets.In topology, these become ConfigMap/Secret → transport and Secret → TLSStore
configuresedges. A transport's CA ConfigMap gets a stub node when it isn't otherwise shown, as its Secrets already do. The drawer lists them under Configuration.In the audit,
traefik.ioServersTransport and ServersTransportTCP now count as ConfigMap consumers. Only that group hasrootCAs, so the legacytraefik.containo.usgroup does not.tls.storeis no longer drawn. Traefik serves every route from thedefaultTLSStore and never reads a route's store reference: its own field comment says onlydefaultcan be used, andgetTLSHTTP/getTLSTCPignore it. The drawer's TLS section still shows the field as written.Result on a live cluster
Traefik 3.7.14 on EKS: a ServersTransportTCP with
spec.tls.rootCAs(a ConfigMap) andcertificatesSecrets, adefaultTLSStore with an extra certificate, and an IngressRoute naming that store.Testing
rootCAsSecret, ConfigMap and both-set entries, and TLSStore certificates.TestTraefikTLSMaterialEdgesFollowTraefiksFieldsfor every edge, plus the absence of the TLSStore → route edge and of a top-level field on a TCP transport.make testpasses. Two timing-sensitive tests in unrelated packages (cmd/desktop,internal/ai) timed out once under load and pass on rerun.TestProjectionConfigurationDirectionno longer expects the TLSStore → IngressRoute edge. An audit fixture wrotecertificatesSecretsas[{name: …}]; every Traefik version declares it a string list, so the fixture now uses strings.