patches is applied in different order than patchesJson6902 #5875
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened?
tl;dr: while
patchesJson6902
is applied aftercommonLabels
(andlabels
),patches
is applied beforecommonLabels
andlabels
.I was updating a kustomize v3.10.0 project to v5.6.0. The build was running fine and gave the same output with kustomize v5.6.0 than with v3.10.0, but I got a warning that
patchesJson6902
andcommonLabels
were deprecated and I should update topatches
andlabels
respectively.After switching to the "new"
patches
andlabels
the output changed. A lot of debugging later, I realised thatpatches
is applied afterlabels
(andcommonLabels
) whilepatchesJson6902
is applied beforelabels
(andcommonLabels
).FYI: I did the migration first with
kustomize edit fix
and then manually just in case the automatic migration did something odd, but got the same result in both cases.What did you expect to happen?
I expected that switching from
patchesJson6902
topatches
would give me the same result, as documented, but instead the output changed.If this change in behaviour is by design it should be mentioned in the documentation. Current docs make you believe that switching from patchesJson6902 to patches is straight-forward (it is true for most cases)
How can we reproduce it (as minimally and precisely as possible)?
Expected output
Actual output
The expected output is what you get if you comment the
patches
section and uncomment thepatchesJson6902
section in the kustomization.yaml file above.Kustomize version
5.6.10
Operating system
MacOS
The text was updated successfully, but these errors were encountered: