-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
TXT registry: metadata format #4624
base: master
Are you sure you want to change the base?
TXT registry: metadata format #4624
Conversation
Hi @mcharriere. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Would be good to keep this going, having duplicated TXT records following both formats is creating a lot of visual pollution in the zone. |
350852a
to
151cfe7
Compare
/ok-to-test |
/lgtm |
The reference to slack does not work for me in the browser. Can you post a link to the discussion for weblicents? |
registry/txt.go
Outdated
|
||
const ( | ||
TXTFormatTransition TXTFormat = "transition" | ||
TXTFormatOnlyMetadata TXTFormat = "only-metadata" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like an enum and we should use this:
type TXTFormat int
const (
TXTFormatTransition TXTFormat = iota + 1
TXTFormatOnlyMetadata
)
func (t TXTFormat) String() string {
switch t {
case TXTFormatTransition:
return "transition"
case TXTFormatOnlyMetadata:
return "only-metadata"
}
return "unknown"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to simplify and stick to strings, in alignment with the code style of the project (as in here)
Validation of these values is done as per user input, as calling external-dns with an invalid input fails with:
build/external-dns --txt-format invalid-format
FATA[0000] flag parsing error: enum value must be one of transition,only-metadata, got 'invalid-format'
registry/txt.go
Outdated
txtNew.ProviderSpecific = r.ProviderSpecific | ||
endpoints = append(endpoints, txtNew) | ||
|
||
// "new" (version 2) TXT record format (containing record type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to have a reference to a doc where "new" (version 2)
is defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT there are no docs referencing this format in the master
branch, but all I can find is this doc that was removed some time ago.
The new term was introduced during the proposal and it's probably not the best way to describe it, as this PR adds yet another new format.
I could link that file or we could name the format differently. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say write a section in a doc about it and reference that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a reference.
registry/txt.go
Outdated
switch name { | ||
case TXTFormatTransition.String(): | ||
return TXTFormatTransition | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so if we do things wrong we hide errors by choosing TXTFormatOnlyMetadata
, IMO wrong choice.
Be explicit and have an UknownFormat for example in the enum that is the 0-value.
registry/txt.go
Outdated
} | ||
} | ||
|
||
// Metadata TXT record format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which version ? old/new?
The comment I can get from the variable name txtMetadata
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As old
and new
age badly, the name metadata
for this format was introduced (see the PR and issues referenced above). This is the format that is supposed to replace the other 2 at some point in time, meaning that the old
and new
should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I would just drop the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for keeping the comment, the purpose is mostly to demarcate the 3 different code blocks (each TXTFormat). To make it consistent I added a reference to the docs that describes the Metadata TXTFormat.
4b8a6a1
to
cf0c3a6
Compare
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
Validation for parameters is already done in a previous stage. Signed-off-by: Matias Charriere <[email protected]>
Signed-off-by: Matias Charriere <[email protected]>
c25a544
to
952739b
Compare
I just rebased to master to keep up to date. @mloiseleur @szuecs when you have some time, could you please take a look into this PR? thank you! |
Co-authored-by: Michel Loiseleur <[email protected]>
/lgtm |
Description
This PR is the continuation of the work done in #3774
It includes a new option to select between 2 different modes:
I mostly resolved conflicts with
master
. Docs are still missing, but I think that all of the comments in the previous PR have been addressed. Including the integration with the AWS Alias behavior change.Ref https://app.slack.com/client/T09NY5SBT/C771MKDKQ
Fixes #3757
Checklist