Skip to content

Conversation

bachorp
Copy link
Contributor

@bachorp bachorp commented Jul 24, 2025

What does it do ?

This patch set refactors the Changes struct to reflect the relationship of UpdateOld and UpdateNew.

// Old Format
type ChangesV1 struct {
	Create    []*endpoint.Endpoint
	UpdateOld []*endpoint.Endpoint
	UpdateNew []*endpoint.Endpoint
	Delete    []*endpoint.Endpoint
}

// New Format
type Changes struct {
	Create []*endpoint.Endpoint
	Update []*Update
	Delete []*endpoint.Endpoint
}

type Update struct {
	Old *endpoint.Endpoint
	New *endpoint.Endpoint
}

Interestingly, there is one test case, TestApplyRecordsOnEncryptionKeyChangeWithKeyIdLabel, that does not work under the new regime, which hints at some other problem with either the test case or the implementation.

If need be, this PR can be split into a sequence of PRs, depending on maintainer feedback.

Motivation

New and Old parts of updates cannot be treated independently. Pairing corresponding Endpoint objects guarantees that matching parts will stick together. This allows for simpler code at use sites of Changes (mainly Provider.ApplyChanges) and evades some class of indexing bugs such as #5542.

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 24, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@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 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 requested a review from mloiseleur July 24, 2025 08:45
@k8s-ci-robot k8s-ci-robot added the controller Issues or PRs related to the controller label Jul 24, 2025
@k8s-ci-robot k8s-ci-robot requested a review from szuecs July 24, 2025 08:45
@k8s-ci-robot k8s-ci-robot added plan Issues or PRs related to external-dns plan provider Issues or PRs related to a provider cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. registry Issues or PRs related to a registry labels Jul 24, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @bachorp!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 24, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @bachorp. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 24, 2025
@ivankatliarchuk
Copy link
Member

Maybe. Hard to say where this refactoring will provide benefits or not. Most likely yes.

Greater Encapsulation - definately something nice to have.
~2000 lines of changes, most likely a no-go. Needs to be sliced differently. But first worth to w8 for other maintainers opinion @mloiseleur, @szuecs and @Raffo

If this will be accepted, I think we should first made a decision about following PRs

  1. fix(txt-registry): skip creation of already-existing TXT records (#4914) #5459
  2. feat(events): raise k8s events with fake provider #5659

@mloiseleur
Copy link
Collaborator

This refactor makes sense to me.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 25, 2025
@ivankatliarchuk
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 29, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2025
@ivankatliarchuk
Copy link
Member

Was it tested on real cluster? No changes detected?

@bachorp
Copy link
Contributor Author

bachorp commented Aug 5, 2025

Was it tested on real cluster? No changes detected?

No. I could most probably do so in a couple weeks.

@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 20, 2025
@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-sigs/prow repository.

@mloiseleur
Copy link
Collaborator

mloiseleur commented Aug 28, 2025

@bachorp We will release next week. If you can test (and rebase) this PR before, maybe it will make it. Otherwise it will be for the next release.

@bachorp
Copy link
Contributor Author

bachorp commented Sep 1, 2025

@mloiseleur Thanks for the info! I just shaved off a few patches that could make it into this week's release. For the main part I would then target the one afterwards.

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. controller Issues or PRs related to the controller 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. plan Issues or PRs related to external-dns plan provider Issues or PRs related to a provider registry Issues or PRs related to a registry size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants