You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applying fails with error: Error: add operation does not apply: doc is missing path: "/spec/template/metadata/annotations/my-annotation": missing value
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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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