-
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
Patch conflation shouldn't use patching to merge patches #3394
Comments
monopole
added a commit
to monopole/kustomize
that referenced
this issue
Dec 26, 2020
monopole
changed the title
Patch conflation code path under kyaml shouldn't use patching to merge patches
Patch conflation shouldn't use patching to merge patches
Dec 26, 2020
natasha41575
pushed a commit
to natasha41575/kustomize
that referenced
this issue
Jan 13, 2021
monopole
added a commit
to monopole/kustomize
that referenced
this issue
Mar 14, 2021
monopole
added a commit
to monopole/kustomize
that referenced
this issue
Mar 16, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Under kyaml, the patch conflict detector and merging mechanism
https://github.com/kubernetes-sigs/kustomize/blob/master/api/resmap/merginator.go#L76
uses a patching approach rather than an object merge approach.
I.e., to conflate N patches, the second patch is applied to the first patch,
and the third patch is applied to that, etc. instead of merging the fields without
treating them as patching each other.
This results in a problem when two or more patches are applied at the same level to
the same object. Not a frequent use case, but it can happen and we have a test
covering it in
api/krusty/multiplepatch_test.go: TestRemoveEmptyDirWithPatchesAtSameLevel
An attempt to use a patch to drop the volume
emptyDir {}
field bypatching it with
emptyDir null
works when used in a single patch, butfails in a multi-patch context because the null field is dropped in the
patch conflation.
Possibly related: #2037
The text was updated successfully, but these errors were encountered: