Skip to content

fix(cloudflare): handle 81058 identical record error for region migration#6090

Closed
AndrewCharlesHay wants to merge 15 commits intokubernetes-sigs:masterfrom
AndrewCharlesHay:fix/cloudflare-fedramp-conflict
Closed

fix(cloudflare): handle 81058 identical record error for region migration#6090
AndrewCharlesHay wants to merge 15 commits intokubernetes-sigs:masterfrom
AndrewCharlesHay:fix/cloudflare-fedramp-conflict

Conversation

@AndrewCharlesHay
Copy link
Copy Markdown
Contributor

@AndrewCharlesHay AndrewCharlesHay commented Jan 9, 2026

What does it do ?

Solves #6091

Motivation

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

@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 szuecs 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 provider Issues or PRs related to a provider size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 9, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 9, 2026

Pull Request Test Coverage Report for Build 20928128947

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 570 unchanged lines in 26 files lost coverage.
  • Overall coverage increased (+0.08%) to 78.982%

Files with Coverage Reduction New Missed Lines %
apis/externaldns/types.go 1 99.62%
utils.go 1 96.0%
pod.go 2 95.54%
v1alpha1/groupversion_info.go 3 0.0%
informers/informers.go 4 81.82%
openshift_route.go 7 84.78%
node.go 9 90.48%
f5_virtualserver.go 9 79.21%
skipper_routegroup.go 9 38.84%
f5_transportserver.go 9 77.42%
Totals Coverage Status
Change from base Build 20810601084: 0.08%
Covered Lines: 16027
Relevant Lines: 20292

💛 - Coveralls

@AndrewCharlesHay AndrewCharlesHay force-pushed the fix/cloudflare-fedramp-conflict branch from 6de7f7d to 78a65aa Compare January 9, 2026 13:55
}

func (p *CloudFlareProvider) resolveIdenticalRecordConflict(ctx context.Context, zoneID string, record dns.RecordResponse) error {
// To resolve the conflict, we need to find the existing record (likely Global) and delete it.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To me, there is an issue here.
ExternalDNS should never decide to delete a record created externally (by the user or other app).
This is not what most users will expect and may lead to severe production or security issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mloiseleur Thank you for the feedback.
I have updated the PR to put this behavior behind an explicit opt-in flag: --cloudflare-region-key-conflict-resolution.

  • Default behavior: Log the conflict error (81058) and fail gracefully (no deletion), advising the user to enable the flag if desired.
  • With Flag: Perform the lookup-and-delete resolution strategy to unblock the region-key record creation.

This ensures operators consciously opt-in to the potential destructiveness of replacing global records with regional ones.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mloiseleur Does that sound good?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR introduces "lost ownership" problem. The external dns has a mechanism to identify the ownership. If record is not owned by the "external-dns" or there is a problem with the record - external-dns is not responsible for fixing it.

In this case, most likely, if there is an issue - log the problem, throw soft error and move on.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I found this comment #5459 (comment). Could be relevant, that describes overl external-dns behaviour in similar cases.

Copy link
Copy Markdown
Member

@ivankatliarchuk ivankatliarchuk Jan 16, 2026

Choose a reason for hiding this comment

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

Probably worth to add to the docs somewhere, so it's super clear.

If we think, it is worth to challange status quo - most likely worth to start a discussion in the slack or short proposal https://github.com/kubernetes-sigs/external-dns/tree/master/docs/proposal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we have something misconfigured on our system. External DNS is updating the region in place now. I'm going to close this PR

@k8s-ci-robot k8s-ci-robot added apis Issues or PRs related to API change controller Issues or PRs related to the controller github_actions Pull requests that update GitHub Actions code labels Jan 11, 2026
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 11, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

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.

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

Labels

apis Issues or PRs related to API change cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. controller Issues or PRs related to the controller docs github_actions Pull requests that update GitHub Actions code needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. provider Issues or PRs related to a provider size/L Denotes a PR that changes 100-499 lines, ignoring generated files. source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants