feat(annotations): Support multiple annotation prefixes#6449
Conversation
|
Skipping CI for Draft Pull Request. |
|
[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 |
Coverage Report for CI Build 26315605530Coverage increased (+0.09%) to 80.707%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions346 previously-covered lines in 10 files lost coverage.
Coverage Stats
💛 - Coveralls |
76ef421 to
80d40be
Compare
9d97f63 to
40f6229
Compare
TestsFlags--source=ingress
--provider=awsManifestsapiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-conflict
namespace: test
annotations:
external-dns.alpha.kubernetes.io/target: "1.1.1.1"
external-dns.kubernetes.io/target: "1.1.1.2"
spec:
rules:
- host: test-conflict.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: test
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-alpha
namespace: test
annotations:
external-dns.alpha.kubernetes.io/target: "1.1.1.1"
spec:
rules:
- host: test-alpha.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: test
port:
number: 80Results$ aws route53 list-resource-record-sets --hosted-zone-id /hostedzone/xxx --query 'ResourceRecordSets[?Name==`test-conflict.example.com.`]'
[
{
"Name": "test-conflict.example.com.",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
{
"Value": "1.1.1.2"
}
]
}
]
$ aws route53 list-resource-record-sets --hosted-zone-id /hostedzone/xxx --query 'ResourceRecordSets[?Name==`test-alpha.example.com.`]'
[
{
"Name": "test-conflict.example.com.",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
{
"Value": "1.1.1.1"
}
]
}
] |
40f6229 to
621450a
Compare
|
PR needs rebase. 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. |
|
Dual-prefix lookup creates undefined behavior. When a resource has BOTH external-dns.alpha.kubernetes.io/hostname: a.example.com AND external-dns.kubernetes.io/hostname: b.example.com (which is possible mid-migration), which value wins? The "first wins" fallback is arbitrary and silent. We now have one more failure mode. We now have to maintain dual-prefix semantics, test every annotation in two modes, and reason about it in every bug report - indefinitely. Flags added for "temporary migration" in infrastructure tools routinely survive for years. The migration window you're designing for becomes permanent operational complexity. Annotation migration is one off operation. It should not be part of a controller |
What does it do ?
This PR adds support for multiple annotation prefixes, with transparent normalization to a single internal prefix.
Key changes:
Motivation
This PR improves backward compatibility and migration ergonomics to the new GA annotation prefix introduced in #6424 by allowing external-dns to accept multiple prefixes while processing them consistently as one canonical prefix.
More