Open ciis0 opened 1 year ago
I think allowing custom merge keys easily is definitely something we want to support, but we will have to look at it holisitcally with https://github.com/kubernetes-sigs/kustomize/issues/3944 and https://github.com/kubernetes-sigs/kustomize/issues/3945.
We are currently working on a roadmap for the rest of the year and putting those two issues as one of the higher priorities. I will add a note that the design for those issues should address this one as well.
/triage accepted /priority important long-term /assign
@natasha41575: The label(s) priority/important, priority/long-term
cannot be applied, because the repository doesn't have them.
FWIW, replacements
don't seem to have any effect on volumeClaimTemplates
too
This issue has not been updated in over 1 year, and should be re-triaged.
You can:
/triage accepted
(org members only)/close
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-triage accepted
Eschewed features
What would you like to have added?
An option to add
x-kubernetes-merge-key
options to exiting OpenAPI resources (e.g.io.k8s.api.core.v1.ConfigMapVolumeSource
)maybe something like:
Why is this needed?
Some locations in kubernetes OpenAPI are missing merge keys, some intentionally, some likely bugs:
A
StatefulSets
'volumeClaimTemplates
are missing merge keys, so you cannot use SMP for setting the setting or overwriting thestorageClass
of avolumeClaimTemplate
. From kubernetes PoV this is intentional as patching a STSvolumeClaimTemplate
is illegal, you need to recreate the STS for that, so k8s does not really have a motivation to fix it. :) (https://github.com/kubernetes/kubernetes/issues/74819, https://github.com/kubernetes-sigs/kustomize/issues/819)ConfigMapVolumeSource
's items are missing merge keys, so you cannot use a SMP for appending a key/path pair to an existingconfigMap
volume. This likely is a bug.Can you accomplish the motivating task without this feature, and if so, how?
Not really.
What other solutions have you considered?
JSON Patches: As both volumeClaimTemplates and configMap volume items are a list-of-maps, one would need to rely on list order.
Anything else we should know?
An example:
with
this results in:
while my expected output would be
Feature ownership