Skip to content
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

New txt registry format #3774

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

cgroschupp
Copy link
Contributor

Description
Added new txt format metadata

Fixes #3757

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 10, 2023
@johngmyers
Copy link
Contributor

johngmyers commented Jul 11, 2023

The code also needs to be able to read the metadata format.

The code does not need to support all possible combinatorics of generating old, new, and metadata. There are only two possible states needed: transition and metadata-only. In transition (default) it should generate metadata format for all records, old format for non-AAAA records, and new format for AAAA records. In metadata-only, it should only generate metadata-format records.

In all cases it should read all three formats. If it reads a format it is configured to not generate, it matches the owner, and it has also read a corresponding metadata-format record, then it should return an Endpoint so the older record gets deleted. See #3726.

registry/txt.go Outdated Show resolved Hide resolved
@cgroschupp
Copy link
Contributor Author

cgroschupp commented Jul 19, 2023

The code also needs to be able to read the metadata format.

@johngmyers I hope I have understood this correctly. I have to think about how to solve it better in extractRecordType.

In transition (default) it should generate metadata format for all records, old format for non-AAAA records, and new format for AAAA records. In metadata-only, it should only generate metadata-format records.

CNAME should also use the new format. This is because it is not possible to create a TXT and CNAME record for the same name.

It may be better to change the type to bool and rename the flag to TXTFormatTransitionEnabled.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 7, 2023
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 8, 2023
@johngmyers
Copy link
Contributor

@cgroschupp are you able to rebase?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 30, 2023
@cgroschupp
Copy link
Contributor Author

@johngmyers done

Copy link
Contributor

@johngmyers johngmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're getting close. Consider taking this out of Draft state.

registry/txt.go Outdated Show resolved Hide resolved
registry/txt.go Outdated Show resolved Hide resolved
registry/txt.go Outdated Show resolved Hide resolved
registry/txt.go Outdated
@@ -215,7 +219,7 @@ func (im *TXTRegistry) generateTXTRecord(r *endpoint.Endpoint) []*endpoint.Endpo

endpoints := make([]*endpoint.Endpoint, 0)

if !im.mapper.recordTypeInAffix() && r.RecordType != endpoint.RecordTypeAAAA {
if !im.mapper.recordTypeInAffix() && im.txtFormat == "transition" && r.RecordType != endpoint.RecordTypeAAAA && r.RecordType != endpoint.RecordTypeCNAME {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should suppress these for type CNAME. I've seen cases where the "new" format wasn't created because the domain got too long. The old format was created because the CNAME was really a Route53 alias record. Perhaps we just need to make this dependent on #3910.

registry/txt_test.go Show resolved Hide resolved
registry/txt_test.go Show resolved Hide resolved
registry/txt_test.go Show resolved Hide resolved
registry/txt_test.go Show resolved Hide resolved
@@ -451,6 +471,7 @@ func testTXTRegistryApplyChanges(t *testing.T) {
t.Run("With Templated Suffix", testTXTRegistryApplyChangesWithTemplatedSuffix)
t.Run("With Suffix", testTXTRegistryApplyChangesWithSuffix)
t.Run("No prefix", testTXTRegistryApplyChangesNoPrefix)
t.Run("No prefix Metadata Only", testTXTRegistryApplyChangesNoPrefixMetadataOnly)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call this just "Metadata only". The results should be the same for with-prefix and with-suffix and the code should test those cases as well.

registry/txt_test.go Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raffo for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 5, 2023
@johngmyers
Copy link
Contributor

/hold for #3910

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 16, 2023
@johngmyers
Copy link
Contributor

johngmyers commented Sep 18, 2023

@cgroschupp please update to account for changes in #3910. RecordTypeA records with an alias ProviderSpecificProperty of true should be encoded in the "new" format as if they had type CNAME. For the "metadata" format they should be encoded as type A.

/hold cancel

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Sep 18, 2023
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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/test-infra repository.

@johngmyers
Copy link
Contributor

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Sep 18, 2023
@johngmyers
Copy link
Contributor

@cgroschupp are you able to rebase and adjust for changes from #3910?

@mloiseleur
Copy link
Contributor

@cgroschupp Do you think you can rebase this PR ?

@k8s-ci-robot
Copy link
Contributor

@cgroschupp: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-external-dns-licensecheck 9d3fca0 link true /test pull-external-dns-licensecheck

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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/test-infra repository. I understand the commands that are listed here.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 2, 2024
@nipr-jdoenges
Copy link

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 2, 2024
@Evesy
Copy link
Contributor

Evesy commented Jun 11, 2024

@cgroschupp Are you still planning to continue with this PR?

@johngmyers Were the changes required to account for #3910 the only outstanding actions stopping this being merged? Keen to see a resolution to #3757 and this PR seems like the best approach so far

@mcharriere mcharriere mentioned this pull request Jul 19, 2024
2 tasks
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 9, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 9, 2024
@frittentheke
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple design failures in new-format TXT registry ownership records
8 participants