feat: allow overriding external-dns hostname annotation#3087
Open
raphaeltorquat0 wants to merge 1 commit intozalando:masterfrom
Open
feat: allow overriding external-dns hostname annotation#3087raphaeltorquat0 wants to merge 1 commit intozalando:masterfrom
raphaeltorquat0 wants to merge 1 commit intozalando:masterfrom
Conversation
This change allows users to override the external-dns.alpha.kubernetes.io/hostname annotation by specifying it in serviceAnnotations, masterServiceAnnotations, or replicaServiceAnnotations in the cluster manifest. Previously, the operator always overwrote this annotation with the value from master_dns_name_format or replica_dns_name_format. Now, if the user has already defined the annotation, the operator will preserve the user's value. Changes: - Modified generateServiceAnnotations() to check if annotation exists before setting - Updated tests to verify user-defined annotations are preserved - Updated documentation to reflect the new behavior Closes zalando#2591
Author
|
Hi @FxKu, could you please add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allows users to override the
external-dns.alpha.kubernetes.io/hostnameannotation by specifying it inserviceAnnotations,masterServiceAnnotations, orreplicaServiceAnnotationsin the cluster manifest.Fixes #2591
Changes
generateServiceAnnotations()to check if the DNS annotation already exists before setting itBefore
The operator always overwrote the
external-dns.alpha.kubernetes.io/hostnameannotation with the value frommaster_dns_name_formatorreplica_dns_name_format, ignoring any user-defined value.After
If the user has already defined the
external-dns.alpha.kubernetes.io/hostnameannotation in their service annotations, the operator will preserve that value instead of overwriting it.Test plan
go test ./...)Disclosure: I used AI assistance (Claude) to help implement this change under my review and testing.