Skip to content

Implement idempotent patching in a helper package #481

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

Open
dlipovetsky opened this issue Mar 29, 2024 · 0 comments
Open

Implement idempotent patching in a helper package #481

dlipovetsky opened this issue Mar 29, 2024 · 0 comments

Comments

@dlipovetsky
Copy link
Contributor

Idempotence: An External Patch Extension must only return patches if changes to the templates are required, i.e. unnecessary patches when the template is already in the desired state must be avoided.
-- https://cluster-api.sigs.k8s.io/tasks/experimental-features/runtime-sdk/implement-topology-mutation-hook#patch-extension-guidelines

We want patches to be idempotent.

Right now, this burden is the individual patch handlers, namely, the Mutate method defined in the MetaMutator interface).

I think we should implement idempotent patching in a package that all handlers can use, for at least these reasons:

  1. Idempotence is hard to get right
  2. Idempotent patching can be implemented in a way that's not specific to any one handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant