Repository navigation
Conversation
|
[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 |
|
Hi @Davien21. 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. |
9b2bb09 to
5f214db
Compare
5f214db to
13fffa5
Compare
What does it do ?
Endpoint.Validatenow checks targets for CNAME, NS and DNAME records and for alias A/AAAA/CNAME records (they must be domain names), and for TLSA (parsed withNewTLSARecord).The domain-name check rejects whitespace and empty labels before calling
dns.IsDomainName, which on its own acceptsbad targetbecause a wire-format label can hold any octet. Underscore labels stay valid.Motivation
Fixes #6874. Some providers apply an update as a non-atomic delete plus create. With an invalid target the delete goes through, the create fails, and nothing is reported: rfc2136 sends only the removal for
CNAME "bad target", and Cloudflare does the same for TLSA. Rejecting these endpoints inValidatedrops them in the dedup wrapper (with a warning and theinvalid_endpointsmetric) before any provider sees them.Tested with
go test ./...(-raceon./endpoint/...and./source/wrappers/...) andgolangci-lint run ./endpoint/...(v2.14.0, 0 issues).TestServiceSource/Endpointsneeds live DNS and failed in my sandbox with or without this change. The 9 new invalid-target cases inTestValidatefail on master.This PR was written in part with the assistance of generative AI.
@adityamukesh I had this ready from the #6873 validation work. If you're already deep into it, I'm happy to close this.
More