fix(source): scope CNAME conflict warnings to the configured domain filter#6579
fix(source): scope CNAME conflict warnings to the configured domain filter#6579jojinkb wants to merge 1 commit into
Conversation
…ilter The "Only one CNAME per name" warning was emitted inside endpoint.MergeEndpoints(), before the configured domain filter is applied, so it fired for hosts (e.g. Istio or Ingress hosts used purely for in-cluster routing) that this ExternalDNS instance will never manage. Move the user-facing warning into a new CNAMEConflictSource wrapper that runs after all sources are combined and only warns for DNS names matching the domain filter. Conflicts on out-of-scope names, and the per-source detection in MergeEndpoints, are logged at debug level instead. In-scope conflicts keep the exact same warn-level message, and cross-source conflicts are now detected as well. Signed-off-by: Jojin <jojin.kb@gmail.com>
|
Welcome @jojinkb! |
|
Hi @jojinkb. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What does it do ?
Stops the
Only one CNAME per namewarning from firing for DNS names that are outside the configured--domain-filter(and related--exclude-domains/--regex-domain-filter/--regex-domain-exclusionflags), while keeping the exact same warn-level message for names this instance actually manages.Since #6174, sources call
endpoint.MergeEndpoints(), which emitted the warning before the planner applies the domain filter — so hosts that exist purely for in-cluster routing (Istio Gateways/VirtualServices, Ingress hosts used by a CDN, ...) produced a misleading warning every sync interval even though ExternalDNS will never manage them.Following the reviewer guidance on #6551 (fix it generically for all sources, gate the warning instead of pre-filtering endpoints, and use the source-wrapper pattern like
nat64source), this PR:CNAMEConflictSourcewrapper (source/wrappers/cnameconflictsource.go) installed at the end of the standard wrapper pipeline. It detects CNAME endpoints sharing the same DNS name + set identifier with different targets and warns only when the name matches the domain filter; out-of-scope conflicts are logged at debug level. Endpoints are returned unmodified — conflicting records are still resolved by the planner's conflict resolver, exactly as before.endpoint.MergeEndpoints()to debug level (same message text, still useful to trace which source produced a conflict). Because the wrapper runs on the combined output of all sources, conflicts across sources (e.g.istio-gatewayvsistio-virtualservice, the exact repro in the issue) are now detected too, which the per-source merge could miss.DomainFilteronce insource.NewSourceConfig()and shares it between the wrapper pipeline and the provider (controller/execute.gopreviously constructed it separately).Behavior summary:
Fixes #6529
Motivation
Users running
--source=istio-gateway --source=istio-virtualservice(or plain Ingress, see the issue comments) with a--domain-filterget warnings every minute about "invalid DNS" for hosts that are intentionally not managed by ExternalDNS. The warning is legitimate signal for in-scope conflicts — per the maintainer feedback on #6551 it must not simply be hidden — but for out-of-scope names it is pure noise that looks like a real DNS problem.Previous attempts #6546 and #6551 were closed after review feedback; this implements the design suggested there: keep the warning, gate it by the domain filter, apply it once for all sources via a wrapper.
Note on scope: the warning is gated by the
--domain-filterfamily of flags only. Provider zone filters (e.g.--zone-id-filter) are not consulted, because zones are only known to the provider at plan time; if reviewers prefer gating on the registry/provider filter as well, the detection could instead move toplan.Calculate()— happy to adjust.More
This change was developed with AI assistance (Claude Code); I have reviewed and tested it.