api icon indicating copy to clipboard operation
api copied to clipboard

support SMP in appropriate types

Open sascha-tanke-bdr opened this issue 5 months ago • 1 comments

Some type definitions are not supporting strategic merge patches (SMP). This makes it hard, to patch resources from different sides.

An example:

An ArgoCD rolles out a patch to .spec.servers in dnses.operator.openshift.io, as it defines some forwards for special dns setups. On top Submariner Operator wants to patch its lighthouse forward into the same resource. That isn't working, as SMP is not support via a mergeKey (https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#merge-individual-elements-of-a-list-of-complex-elements, https://github.com/kubernetes/apimachinery/blob/268a6d0fb19c92c9665e8f5cd85b564557038dc1/pkg/util/strategicpatch/patch.go#L321). This could be made possible by adding patchMergeKey to: https://github.com/openshift/api/blob/bfcb56b390563c584d132ee0728f6ffc660e8e15/operator/v1/types_dns.go#L55

Would be nice to add this to all appropriate types.

sascha-tanke-bdr avatar Oct 02 '25 05:10 sascha-tanke-bdr

Strategic merge patch is only for API types that are served by Kube directly, or for aggregated API servers. They are not for custom resources definitions (see slack)

So this type shouldn't have merge patch markers.

What it should have though is +listType=map and then +listMapKey.

However, this is a breaking change. If the list is otherwise not labelled, it is considered atomic, and so behaviour will change if we were to retrofit these tags now.

JoelSpeed avatar Oct 21 '25 10:10 JoelSpeed

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Jan 20 '26 01:01 openshift-bot