-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
patches
has odd behaviour when an entry is missing its' merge key
#5369
Comments
This issue is currently awaiting triage. SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
What happened?
If you have a
Deployment
defined with more than one container, and one of those containers is missing theirname
field, applying a patch on one of the other containers, the properly named containers risks disappearing.This is similar to issue #5150. In this case however, I have one or more containers that do have their merge key present. It still seems like kustomize drops all containers that has a proper merge key, only keeping the containers that lacks one.
The same phenomena can be seen in other places, for example with an
env
list. If the base deployment has two proper entries, and a patch tries to add a 3rd missing it's merge key (i.e. it only has a value, no name), then list gets empties completely.What did you expect to happen?
Given the example I provide below, I'd expected either of these (with nr 2 being the more likely):
""
(Or maybenull
? I don't know the internals well enough), differentiating it from the other containers.In either case, I think
kustomize
should output some kind of warning, or even fail outright since the input manifest is broken, and entries with missing merge keys can have unexpected consequences (such as a env entry with a missing name).How can we reproduce it (as minimally and precisely as possible)?
kustomize build .
Expected output
Actual output
Kustomize version
5.1.1
Operating system
MacOS
The text was updated successfully, but these errors were encountered: