-
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
Improve variable expansion to include tree structures #1190
Comments
If your example is the main use case, I would probably go with PodPresets. It's neater and probably going to be easier to manage in the long term than variables. If you need to reference other types of resources, maybe YAML anchors and references? (I didn't test this on kustomize yet, no idea if it works) |
@benjamin-bergia good points. PodPresets/admission controllers/controllers can do pretty much anything. kustomize is a client side alternative to that for generating final config, pre-cluster, for whatever purpose. fwiw, it's not supposed to depend on stuff being installed in the cluster first. afaik, YAML anchors/references (&'s and *'s) are recognized by Kustomize vars have the drawback that the un-kustomized config cannot be used in var rules are simple, since inventing a programming language is a non-goal of kustomize. All kustomization files in an overlay stack are processed before making a vars replacement pass, and all vars have global scope. so if a base with vars is included multiple times, it will conflict with itself. this could be fixed by introducing a notion of local var, that only applies to the kustomization root in which it is defined (it works down, but not up). We'd need a new term - |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
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. |
I would like to be able to use a variable to reference an entire tree of YAML as opposed to a single piece of primitive data. Consider the following example, where kustomize should take the entire
template
tree from the foo deployment and use it in the bar deployment.kustomization.yaml:
transformer.yaml:
foo/deployment.yaml:
bar/deployment.yaml:
The text was updated successfully, but these errors were encountered: