nutanix-cloud-native / nutanix-cloud-native/cluster-api-runtime-extensions-nutanix
Implement idempotent patching in a helper package
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17
- Forks
- 12
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 10
Description
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:
- Idempotence is hard to get right
- Idempotent patching can be implemented in a way that's not specific to any one handler
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MetaMutator interface and its Mutate method in common/pkg/capi/clustertopology/handlers/mutation/meta.go, then review the existing patch handlers that implement it. Define a shared approach that returns patches only when templates differ from the desired state, and verify that handlers avoid unnecessary patches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100