Skip to content
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

kustomize manifests complaining about deprecated patchesStrategicMerge and patchesJson6902 #1985

Closed
pmalek opened this issue Jun 20, 2023 · 7 comments
Labels

Comments

@pmalek
Copy link
Contributor

pmalek commented Jun 20, 2023

As per kustomize v5 release notes patchesStrategicMerge and patchesJson6902 are deprecated.

Because native manifests still use it, using kustomize v5 yields the following warnings:

# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.

Places where it's used:

@fedepaol
Copy link
Member

Thanks for raising this @pmalek! Fancy trying to fix it?
If not, we'll do :-)

@fedepaol
Copy link
Member

Oh, you filed the PR already ❤️

@pmalek
Copy link
Contributor Author

pmalek commented Jun 20, 2023

I tried to fix it with #1986 but I'm getting:

$ k kustomize ./config/native/
error: accumulating resources: accumulation err='accumulating resources from '../crd': '/Users/USER/code_/metallb/config/crd' must resolve to a file': recursed accumulation of path '/Users/USER/code_/metallb/config/crd': accumulating components: accumulateDirectory: "recursed accumulation of path '/Users/USER/code_/metallb/config/crd/components/crd-conversion-patch': trouble configuring builtin PatchTransformer with config: `\npath: crd-conversion-patch.yaml\n`: unable to parse SM or JSON patch from [# The following patch enables conversion webhook for CRD\n# CRD conversion requires k8s 1.13 or later.\napiVersion: apiextensions.k8s.io/v1\nkind: CustomResourceDefinition\nmetadata:\n 
...
"

Do you happen to know how to tackle this? kustomize edit fix didn't manage to fix it

kustomize edit fix

Fixed fields:
  patchesJson6902 -> patches
  patchesStrategicMerge -> patches
  commonLabels -> labels

To convert vars -> replacements, run the command `kustomize edit fix --vars`

WARNING: Converting vars to replacements will potentially overwrite many resource files
and the resulting files may not produce the same output when `kustomize build` is run.
We recommend doing this in a clean git repository where the change is easy to undo.
Warning: 'Fixed' kustomization now produces the error when running `kustomize build`: accumulating components: accumulateDirectory: "recursed accumulation of path '/Users/USER/code_/metallb/config/crd/components/crd-conversion-patch': trouble configuring builtin PatchTransformer with config: `\npath: crd-conversion-patch.yaml\n`: unable to parse SM or JSON patch from [# The following patch enables conversion webhook for CRD\n# CRD conversion requires k8s 1.13 or later.\napiVersion:

@fedepaol
Copy link
Member

Nope, I remember I tried but it wasn't as straightforward 😅

@pmalek
Copy link
Contributor Author

pmalek commented Jun 20, 2023

Alright, it seems that #1986 might do the job. It produces an empty diff compared to main. I'll mark is as ready for review after tests pass.

@pmalek
Copy link
Contributor Author

pmalek commented Jun 21, 2023

Alright, it seems that the PR needs to be approved by a maintainer first. Marked the PR as ready for review in such case.

@lindhe
Copy link
Contributor

lindhe commented Aug 31, 2023

@fedepaol when will this be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants