Skip to content

Conversation

ivankatliarchuk
Copy link
Contributor

@ivankatliarchuk ivankatliarchuk commented Mar 13, 2025

Description

TODO:

  • ✅ fix tests
  • ✅ test on real cluster and account
  • ✅ review docs
  • ✅ added TXT legacy record cleanup script

Checklist

  • Unit tests updated
  • End user documentation updated

Executed on real cluster with arguments

go run main.go \
    --provider=aws \
    --registry=txt \
    --source=fake \
    --aws-zone-type=private \
    --zone-id-filter=/hostedzone/XXXXXX \
    --log-level=debug \
    --policy=sync \
    --interval=60s \
    --fqdn-template=a1.ex.com

Without change, records current and old format created

aws route53 list-resource-record-sets --hosted-zone-id ${ZONE_UNDER_TEST} --query "ResourceRecordSets[?Type=='TXT'].{Name:Name, Value:ResourceRecords[0].Value}" --output table
-----------------------------------------------------------------------------
|                          ListResourceRecordSets                           |
+--------------------+------------------------------------------------------+
|        Name        |                        Value                         |
+--------------------+------------------------------------------------------+
|  a-fhbr.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-gwbl.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-hgmc.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-hmqw.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-hoxg.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-ipfd.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-melr.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-mkde.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-uknh.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-xiqj.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  fhbr.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  gwbl.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  hgmc.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  hmqw.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  hoxg.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  ipfd.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  melr.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  mkde.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  uknh.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  xiqj.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
+--------------------+------------------------------------------------------+

With the change. New format records created, letagcy TXT records left untouched

❯❯ aws route53 list-resource-record-sets --hosted-zone-id ${ZONE_UNDER_TEST} --query "ResourceRecordSets[?Type=='TXT'].{Name:Name, Value:ResourceRecords[0].Value}" --output table
-----------------------------------------------------------------------------
|                          ListResourceRecordSets                           |
+--------------------+------------------------------------------------------+
|        Name        |                        Value                         |
+--------------------+------------------------------------------------------+
|  a-dkmw.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-ihkf.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-iztb.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-jlmh.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-kmam.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-lqpv.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-rizx.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-sjfa.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-uvlq.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  a-vgpc.a1.ex.com. |  "heritage=external-dns,external-dns/owner=default"  |
|  bwwo.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  ecvx.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  ilan.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  iyda.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  nhhy.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  pazy.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  sdeo.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  tosb.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  wrej.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
|  yymt.a1.ex.com.   |  "heritage=external-dns,external-dns/owner=default"  |
+--------------------+------------------------------------------------------+
``

@ivankatliarchuk ivankatliarchuk marked this pull request as draft March 13, 2025 09:42
@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 Mar 13, 2025
@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 Mar 13, 2025
@ivankatliarchuk
Copy link
Contributor Author

/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 Mar 13, 2025
@ivankatliarchuk
Copy link
Contributor Author

/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Mar 13, 2025
@ivankatliarchuk ivankatliarchuk changed the title WIP: feat(txt-registry): deprecate legacy txt-format feat(txt-registry): deprecate legacy txt-format Mar 14, 2025
@ivankatliarchuk ivankatliarchuk marked this pull request as ready for review March 14, 2025 11:28
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 14, 2025
@ivankatliarchuk ivankatliarchuk requested a review from szuecs June 21, 2025 09:32
@mloiseleur
Copy link
Collaborator

/lgtm
I left some minor suggestion.
I let @szuecs proceed with the final review.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 22, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 22, 2025
@szuecs
Copy link
Contributor

szuecs commented Jun 24, 2025

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: szuecs

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2025
@mloiseleur
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2025
@k8s-ci-robot k8s-ci-robot merged commit 9f16d83 into kubernetes-sigs:master Jun 25, 2025
13 checks passed
@ivankatliarchuk ivankatliarchuk deleted the feat-txt-registry branch June 25, 2025 07:20
@ivankatliarchuk
Copy link
Contributor Author

Screenshot 2025-06-25 at 10 39 05

frittentheke added a commit to inovex/external-dns-openstack-webhook that referenced this pull request Jul 16, 2025
A while back External-DNS changed the format of the TXT records.
To ensure compatibility both formats where used. As an intermediary step a switch was added in [2]
to only create the new format. With [3] the old format was completely removed, thus halfing the
number of TXT records.

[1] https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.18.0
[2] kubernetes-sigs/external-dns#4946
[3] kubernetes-sigs/external-dns#5172
@maartenschalekamp
Copy link

maartenschalekamp commented Jul 17, 2025

This is a breaking change as its causing the error

flag parsing error: unknown long flag '--txt-new-format-only'

Just mentioning it as its not listed as a breaking change on the release notes. Only as a feature.

@frittentheke
Copy link
Contributor

frittentheke commented Jul 17, 2025

This is a breaking change as its causing the error

flag parsing error: unknown long flag '--txt-new-format-only'

Just mentioning it as its not listed as a breaking change on the release notes. Only as a feature.

Would also be nice to point people (again) at the required steps to clean up their otherwise now orphaned records in the old format.

troll-os pushed a commit to FiligranHQ/external-dns that referenced this pull request Aug 28, 2025
* feat(txt-registry): only support single format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): only support single format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): only support single format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): only support single format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): only support single format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Co-authored-by: Michel Loiseleur <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Co-authored-by: Michel Loiseleur <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): address review comments

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

* feat(txt-registry): deprecate legacy txt-format

Co-authored-by: Michel Loiseleur <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

* feat(txt-registry): deprecate legacy txt-format

Signed-off-by: ivan katliarchuk <[email protected]>

---------

Signed-off-by: ivan katliarchuk <[email protected]>
Co-authored-by: Michel Loiseleur <[email protected]>
# Conflicts:
#	controller/execute.go
#	registry/txt.go
#	registry/txt_encryption_test.go
#	registry/txt_test.go
@Phil1602
Copy link

This is a breaking change as its causing the error

flag parsing error: unknown long flag '--txt-new-format-only'

Just mentioning it as its not listed as a breaking change on the release notes. Only as a feature.

Would also be nice to point people (again) at the required steps to clean up their otherwise now orphaned records in the old format.

Yep. Just opened #5868 therefore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. docs kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 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.