-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
configMapRef and secretRef in envFrom are not merged correctly #1835
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Any progress on this issue? I am facing the same problem and would be happy about a fix. |
@MortlMcCrisis haven't done anything in Go so I wouldn't even know where to start.. :D Any idea how to get someone's attention? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale
|
Tested once again with kustomize 3.8.1 and |
Also ran into this issue today. Pulled a good chunk of hair out wondering what I was doing wrong at first but now that I know of this issue, I could work around it. Would be good to address though |
I also ran into this. |
Nevermind, it was not having matching namespaces between cm/secrets and doployment, again. |
any luck with the issue. I still have exactly the same issue. then you use patchesStrategicMerge: to include another yaml that has some more envFrom expectation was that , the output would have all the three configMapRef. but in actual. instead of adding the third configmapref, it is overwritting it and you end with only the 'name: third' in the result. |
Explanation: #3047 (comment)
Example JSON 6902 patch:
Output:
|
But, why is this? Why are some lists mergeable just fine and others are not? To an external part, it kind of looks like this is a matter of just concatenating lists of arbitrary items. I checked in #3047 as well, but this still doesn't really make sense to me:
I can't see the logic why list A can be merged, since it is part of a pre-defined list-of-lists, whereas list B cannot. What makes the two lists so different? |
@Gikkman Because this is a strategic merge patch, not a simple merge. Please take a look at the k8s doc which has a good description. I quote the important sentence here:
And unfortunately,
|
Ah, right, that makes sense now. Thanks for taking the time to explain, I appreciate it! |
Where is it in the source code? I want to make a PR for that... :D also hit with this issue |
ahh we cannot use |
the code is here, if anyone looks for it. I am not sure if this is generated code or the actual code. |
Maybe there should be a special case for this merging like it has been done with images. env and envFrom lists are pretty often specified and their contents differs a lot when having a unified service template, but lots of services. |
Just been hit by this, thanks for all the work in this issue. Finding this helped. |
It's too bad that this doesn't work for edit:
|
I've created a simple sample to demonstrate the incorrent behaviour. I'm trying to append
secretRef
inenvFrom
with patchesStrategicMerge but after mergeconfigMapRef
is missing fromenvFrom
. Am I correct in thinking that this should work as I've shown in expected output? 🤔I also tested a similar use case with
volumeMounts
(seen in examples below) and it works correctly.Version of kustomize:
{Version:3.8.1 GitCommit:0b359d0ef0272e6545eda0e99aacd63aef99c4d0 BuildDate:2020-07-16T05:15:32+01:00 GoOs:darwin GoArch:amd64}
deployment.yaml:
patch.yaml
kustomization.yaml
Current output of
kustomize build
:Expected output of
kustomize build
:The text was updated successfully, but these errors were encountered: