Skip to content

Implement idempotent patching in a helper package #481

@dlipovetsky

Description

@dlipovetsky

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions