Skip to content

fix(exoscale): handle apex DNS records#6369

Draft
natalie-o-perret wants to merge 1 commit intokubernetes-sigs:masterfrom
exoscale:fix/exoscale-apex-dns-records
Draft

fix(exoscale): handle apex DNS records#6369
natalie-o-perret wants to merge 1 commit intokubernetes-sigs:masterfrom
exoscale:fix/exoscale-apex-dns-records

Conversation

@natalie-o-perret
Copy link
Copy Markdown

@natalie-o-perret natalie-o-perret commented Apr 14, 2026

1. external-dns info

This came in as a customer report (no direct cluster access), so I traced it through the source code.

Version: unconfirmed from the customer, but the bug is present in current master (dc28c3e).

Startup flags (from customer description, approximate):

--provider=exoscale
--source=service
--domain-filter=xxx.yy

Debug logs: not available. Based on the code path, EndpointZoneID returns "" for apex records so they are dropped before any change is scheduled. You would never see a CREATE xxx.yy line in the logs.

2. Kubernetes resources

Not available (proprietary infrastructure). The relevant annotation was:

external-dns.alpha.kubernetes.io/hostname: xxx.yy

3. DNS provider: existing vs expected records

Name Type Exists Expected
www.xxx.yy A yes yes, works fine
xxx.yy A no yes, never created

4. TXT ownership records

Not available.


Demonstrating the bug with tests

I added tests that fail against master and pass after the fix. Here is the output against the unpatched code:

$ go test ./provider/exoscale/... -v -run "TestExoscaleApplyChanges_ApexRecord|TestEndpointZoneID_ApexRecord|TestExoscaleGetRecords"

=== RUN   TestExoscaleGetRecords
    exoscale_test.go:129: Error: Should be true     <- "foo.com" not found in Records() output
    exoscale_test.go:130: Error: Should be false    <- ".foo.com" IS present (Records() returns leading dot for apex)
--- FAIL: TestExoscaleGetRecords

=== RUN   TestExoscaleApplyChanges_ApexRecord
    exoscale_test.go:163: Error: "[]" should have 1 item(s), but has 0
--- FAIL: TestExoscaleApplyChanges_ApexRecord
panic: runtime error: index out of range [0] with length 0

FAIL    sigs.k8s.io/external-dns/provider/exoscale

After the fix:

$ go test ./provider/exoscale/... -v -run "TestExoscaleApplyChanges_ApexRecord|TestEndpointZoneID_ApexRecord|TestExoscaleGetRecords"

--- PASS: TestExoscaleGetRecords
--- PASS: TestExoscaleApplyChanges_ApexRecord
--- PASS: TestEndpointZoneID_ApexRecord
ok  sigs.k8s.io/external-dns/provider/exoscale

Note

This PR description was drafted with AI assistance (GitHub Copilot).

EndpointZoneID only matched records where the DNS name had a
dot-prefixed zone suffix (e.g. sub.example.com matches .example.com).
Apex records like example.com do not have that prefix, so they were
silently skipped, causing external-dns to log CREATE but never call
the API.

Fix EndpointZoneID to also match when the DNS name equals the zone
name exactly, returning an empty record name for apex records.

Fix Records() to build the correct FQDN for apex records returned by
the API (Name == ""), which previously produced .example.com instead
of example.com, breaking the idempotency check and causing repeated
CREATE attempts.

Also fix TestExoscaleApplyChanges to reset all global state slices
before running to avoid test-order-dependent failures.
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mloiseleur for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the provider Issues or PRs related to a provider label Apr 14, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

CLA Not Signed

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @natalie-o-perret!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 14, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @natalie-o-perret. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 14, 2026
@brutasse
Copy link
Copy Markdown

CLA Authorization should be in place now.

@ivankatliarchuk
Copy link
Copy Markdown
Member

If there is a bug, please share information in the more receivable format https://github.com/kubernetes-sigs/external-dns/blob/master/docs/contributing/bug-report.md

@natalie-o-perret
Copy link
Copy Markdown
Author

If there is a bug, please share information in the more receivable format https://github.com/kubernetes-sigs/external-dns/blob/master/docs/contributing/bug-report.md

Sure, will do 🙇‍♀️

@ivankatliarchuk
Copy link
Copy Markdown
Member

Not related to this fix exoscale/egoscale#750 but worth to refresh provider in separate PR

@natalie-o-perret
Copy link
Copy Markdown
Author

natalie-o-perret commented Apr 15, 2026

Not related to this fix exoscale/egoscale#750 but worth to refresh provider in separate PR

* dependency bump

* add support for zone caching https://github.com/kubernetes-sigs/external-dns/tree/master/provider/blueprint

* add support for providers GetDomainFilter example PR [feat(pdns): support GetDomainFilter interface #6234]

@ivankatliarchuk, there it is, #6371

Btw, for some reason, while I've done the auth thingy, which did work for my other PR, it doesn't seem the case for that PR here, do you happen to know why?

EasyCLA — Missing CLA Authorization.

@natalie-o-perret natalie-o-perret marked this pull request as draft April 15, 2026 15:29
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. provider Issues or PRs related to a provider size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants