-
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
patchStrategicMerge elides null and {} #2734
Comments
I've stumbled upon the same issue, worth noting that 3.8.1 is still affected. Probably, this issue was introduced with the recent migration from api-machinery to kyaml. Right now, I've switched back to 3.7.0 which is not affected. |
Yes, it's the kyaml. By default kyaml processing does cleanups that should have no impact on KRM use. Dropping fields with value So options are
With any of these options, a user would still have the option to run the yaml It's just a question of what the default should be. I like 2 (drop |
i don't have an example with definitely 2. 3 gets us closer to the behaviour we had up the kustomize.370. What do others think? |
@Shell32-Natsu , let's let this sit for a week to gather comments. Default decision is option 2 (which requires a PR to allow |
@monopole Got that |
Hi @monopole , yes this is definitely a bug, an empty object is completely different compared to Also examples of https://yaml.org/spec/1.2/spec.html#id2805071
For us this causes a huge problem with Prometheus Operator as they require an empty object so that rules are picked up everywhere:
See
The interesting thing is: We would really appreciate a fast fix, thanks! |
I believe HEAD is consistent with option 2 right now, but i'd like to review the tests again to confirm this. We'll be doing a new release shortly |
I come across here after an outage on our system. When
I'm looking forward to a new release of Update: Fyi, Below is the full object manitest they need.
|
Hi @monopole, is that fixed in 3.8.2 https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv3.8.2 ? Many thanks |
@icy Yes the fix is in 3.8.2. |
Thanks a lot for your information, and thanks the team for the fix. I can confirm that my gloo-related problem is gone with 3.8.2 |
Thanks for fixing this so quickly. Was deploying prometheus operator too and had a hell of a time figuring out what happened as I upgraded both kustomize and operator in the same PR. Lesson learned. 3.8.2 fixed |
/close Please reopen if you want to discuss further. |
@Shell32-Natsu: Closing this issue. 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. |
Hi @monopole , when I want to delete some default values in helm chart, it MUST use the for example: # Helm Chart
...
readinessProbe:
httpGet:
path: /index.html
port: 8080
... httpGet probe is conflict with tcpSocket, so if I want to use tcpSocket probe, I must set httpGet to null to delete the default vaule (Although it can be done in the command line with # values.yaml
...
readinessProbe:
tcpSocket:
port: 8080
httpGet: null
... So, I NEED option 3 ^_^ |
@goooogs did you find a solution? Just stumbled upon that very same issue - trying to reset a Helm release vault using |
Hits me too. Can we reopen? |
Hits me too. :-( Has anybody an idea if there is a workaround? |
if you are trying to patch the output of example:
I think that's what all the subsequent commenters are asking for. If not, please provide a concrete use case with code |
@afirth I believe they want to create the helm values itself via kustomize. My use case is using kustomize to generate a flux2 HelmRelease CRD. I normally would |
I have a reproduction case here: #4628 |
Holy cannoli. I see your use case (fluxcd helmRelease values in a CRD) but not sure it's going to get fixed for this, which is essentially providing flat files to go template from a inside a CR.
Hope one of these helps you and others. |
please reactivate this - currently reproing: When trying to change a variable in a deployment from :
to:
if you try to
the only way to make that patch work is to have:
but of course thx! |
@MaurGi
Note this is for the final pod spec, I'm not sure how strategic merge patch will cope. But for example a json6902 add on the end ( |
@monopole - sorry for the delay, i was trying to narrow it down, but probably should bring y'all up to date
This is the follow on to #2697
Dropping the
-emptyDir: {}
leads to a malformed volume declaration in the Deployment objectDropping
creationTimestamp: null
might not matter semantically, but it seems odd that a patch that merges is able to remove somethingif i kustomize build . on this,
- emptyDir: {}
as well ascreationTimestamp: null
gets removed from the object that is built, even though i'm not patching that part of the object.if i remove/comment the patchesStrategicMerge from kustomization.yaml, then the
- emptyDir: {}
andcreationTimestamp: null
passes thru into the resultalmost as if those null empty fields are not retained as you build the object in preparation (or during) the patchesStrategicMerge process
The text was updated successfully, but these errors were encountered: