Env variable not added to multiple deployments with /- in the path if there is no other env variable defined before #5650
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?
When trying to add env variables to several Kubernetes Deployments at the same time, it failed because one of the Deployments manifest didn't have environment variables defined before. Using '/-' don't add it if there are no envs defined in advance, instead it throws the error:
doc is missing path: "/spec/template/spec/containers/0/env/-": missing value
What did you expect to happen?
I expect that, if an item, an env variable in this case, doesn't exist and I end the path with '/-', that it's actually appended at the end. At the end of none, should be the first and only env variable in there.
How can we reproduce it (as minimally and precisely as possible)?
Expected output
Actual output
Kustomize version
v5.0.4-0.20230601165947-6ce0bf390ce3
Operating system
MacOS
The text was updated successfully, but these errors were encountered: