-
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
[Question] Possible to have multiple components that merge / patch on the same list? Last component applied overwrites any previous component patches #4584
Comments
@jketcham: 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 and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
Very interesting question! If I'm understanding your setup correctly, this is a patch, not a
Here are 2 workarounds that target the above problems.
Hope this helps. |
Hi @annasong20 thanks for your detailed response! Yes this is a patch problem. The workarounds you proposed sound like they'd work for the tolerations, but I suppose I may be out of luck for the node affinities. |
I would like to have a base
Deployment
config with a series ofcomponents
that can add values totolerations
andnodeAffinity
selectors, but when I include two components that try to patch/merge on the same list, the last component that is applied overwrites the previous component's patch.I'm essentially trying to achieve the same functionality as outlined in the docs for components.
base-deployment
:bases/deployment/deployment.yaml
:And two components,
run-type-restricted
andrun-type-off-demand
:run-type-restricted
bases/deployment/components/run-type-restricted/kustomization.yaml
:bases/deployment/components/run-type-restricted/patch.yaml
:run-type-off-demand
bases/deployment/components/run-type-off-demand/kustomization.yaml
:bases/deployment/components/run-type-off-demand/patch.yaml
:Now when I try to use them in the base deployment for an app, the last component applied overwrites the previous component patches:
descendant-deployment
Actual output
Expected output
Is this something that should be possible? Or would I need to create multiple base deployments to achieve this?
I've tried this with json patching, but the spec defines that it's not possible to add to a list that doesn't exist yet, and it's not possible to define an empty list for
affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms
(a value is required).Thanks for taking a look!
The text was updated successfully, but these errors were encountered: