-
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
Error: json: cannot unmarshal string into Go struct field Kustomization.patches of type types.Patch #1373
Comments
"patches:" was obsolete. You are supposed to use "patchesStrategicMerge:" instead. Since "patches:" is used for more extended patching. |
thanks, I guess that was it. I think the readme should be updated. |
+1, I hit the same error. My yaml files were generated by kubebuilder, they worked with Kustomize v2, but upgrading Kustomize to v3.0.3 breaks it. |
Interesting...Was looking at the log. patches has been deprecated last year v1.0.9. I guess we will have to check if kubebuilder needs to be updated. Meanwhile the easiest workaround is |
This was probably fine when Chris wrote it in February, but since then the newest release of Kustomization has broken things: kubernetes-sigs/kustomize#1373
Change "patches" to "patchesStrategicMerge". The use of "patches" has been deprecated since v1.0.9: https://github.com/kubernetes-sigs/kustomize/blob/v1.0.9/pkg/types/kustomization.go#L129 With kustomize v3, this fails with a message similar to the one seen in this issue: kubernetes-sigs/kustomize#1373 This change should not result in any change in behavior, but makes this kustomization.yaml no longer use a deprecated field.
@functicons Created a PR in kubebuilder |
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. |
Stale issues rot after 30d 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. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: 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 since patches is obsolete, this example should be removed or updated. |
I think "patches" means something else - not obsolete as of today. |
Okay so the use of "patches" above is not working because it's missing target? And with target specified it's still working/valid use? |
I think the problem is Works in
|
Yep that’s right |
This was made obsolete in v1.0.9 https://github.com/kubernetes-sigs/kustomize/blob/v1.0.9/pkg/types/kustomization.go#L129 And stopped working in v3.0.3 kubernetes-sigs/kustomize#1373
As opposed to pointed out in other comments, The change that worked for me while using
Adding |
This can be automatically done by running |
I had loads of kustomization.yaml files to convert, and this is what I used to find and update all of them.
|
Just came across this issue and had the same problem. It was due to a very complex env var value with several levels of escaping. I was able to fix by moving this env var from the literals in the configMapGenerator to an external env file. |
This was working file with
v3.0.0
, I've updated tov3.0.3
and I'm getting the error:This is the kustomization file:
The text was updated successfully, but these errors were encountered: