-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
configMapGenarator merge behaviour only allows for one override, ignores subsequent overrides #5250
Comments
/assign valaparthvi |
Thanks @valaparthvi! Please see if you can reproduce the issue by comparing the output of |
I suspect this has to do with #5170. @valaparthvi please continue to try to reproduce. |
A workaround could be – implement the overrides from the conifgMapGenerator as a component, and import it that way, but that's clunky in my particular situation where I have an assortment of overlays that share many things in common, and I only override a thing or two differently for each overlay. So this workaround strategy would imply creating a large number of use-only-once components. That is, undesirable. |
I can reproduce this. $ tree
.
├── base
│ └── kustomization.yaml
├── component
│ └── kustomization.yaml
└── overlay
└── kustomization.yaml
3 directories, 3 files Kustomize 4 output
$ kustomize4 build ./overlay
apiVersion: v1
data:
literal_variable_one: overlay-value
literal_variable_two: overlay-value-two
kind: ConfigMap
metadata:
name: literals-configmap-6t592hc2f7
Kustomize 5 output
$ kustomize5 build ./overlay
apiVersion: v1
data:
literal_variable_one: component-value
literal_variable_two: component-value-two
kind: ConfigMap
metadata:
name: literals-configmap-b8d9m4h5k2 |
Hi @Gekalash, we have confirmed that the issues is not in the We tried to run your example with only the This was documented in this Kustomize release. As stated there, #4402 should solve your use case because you'll be able to specify the order that Kustomize fields run in. However, if its implementation is not fast enough for your use case, we invite you to leave feedback on #5141. If there is enough demand there, we'd be interested in coming up with a temporary solution. Regarding your proposal
could you provide us with more information? If you want the override values from the overlay /kind duplicate |
@annasong20: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind support |
Let us know if you have any more information about your use case. Closing this as we are tracking the component/generator ordering in other issues. |
What happened?
configMapGenarator merge behaviour changed between Kustomize v4 and Kustomize v5.
In v4, multiple overrides could be applied to the same value in the configMapGenerator, with the last one applied becoming the final value.
In v5, only the first override is applied, and any subsequent ones are ignored.
What did you expect to happen?
Expected compatible manifests to produce the same results when rendered with Kustomize v4 and v5.
How can we reproduce it (as minimally and precisely as possible)?
Expected output
Actual output
Kustomize version
5.1.0
Operating system
MacOS
The text was updated successfully, but these errors were encountered: