-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent plan reporting endpoint target casing differences as a change #1960
Conversation
This reverts commit 261779c.
Welcome @robselway! |
@robselway thank you for your PR, this sounds like an easy fix for a nasty problem. Frankly, I don't think performance matter in this case, but I do have a question: is it enough to handle the case problem in this single comparison or would it be handy to convert to lowercase to be useful to other parts of the code? I'm thinking that the answer is "no, this is enough", but I'd love to hear your thoughts given that you took a look at the problem. |
Thanks @Raffo. I think this change should be enough to handle it, but it could be worth converting to lowercase in My only reservation is RFC 1035 - 3.3.3 (linked to by @jgrumboe in the original issue) that says:
So if we're sticking close to the spec, we should minimize any transformations and look to compare strings in a case-insensitive manner wherever possible? |
You are right @robselway . Merging as is. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Raffo, robselway The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Fix to prevent the plan reporting a difference in endpoint target casing as a change that needs to be made. This fixes a bug that has so far been identified in the Cloudflare provider where uppercase characters in the
external-dns.alpha.kubernetes.io/target
attribute can cause a CREATE/DELETE loop.I have addressed the issue as centrally as possible to prevent dependencies on the core plan logic needing to think about this scenario, however the trade-off it a performance hit where
!strings.EqualFold()
is more expensive than the previous!=
operation, and would be more expensive than performing astrings.ToLower()
at the edge (e.g. insource
). Happy to change this if we think it's too much.Fixes #1906
Checklist