Replies: 1 comment
-
Maybe a strategic merge patch could help you here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't understand the difference between two jsonPatch
add
operations.Given a simple deployment
deploy.yaml
without any annotations defined:First scenario: adding an annotation to the metadata of the deployment, the deployment has no other annotations defined.
kustomization.yaml
:Works as expected
Second scenario: adding an annotation to the pod template of the deployment, the pod template has no other annotations defined.
Incorrect patch:
Applying fails with error:
Error: add operation does not apply: doc is missing path: "/spec/template/metadata/annotations/my-annotation": missing value
Correct patch:
In the second scenario, I need to add an empty annotations map before I can add the annotation itself. Why does that need to happen for annotations in the pod template, but not for annotations of the deployment itself?
Tested using kustomize v4.5.7
Beta Was this translation helpful? Give feedback.
All reactions