Skip to content
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

How do I re-use a value? #3833

Closed
zhech2 opened this issue Apr 23, 2021 · 2 comments
Closed

How do I re-use a value? #3833

zhech2 opened this issue Apr 23, 2021 · 2 comments

Comments

@zhech2
Copy link

zhech2 commented Apr 23, 2021

We have many images with the same tag and private registry:

images:
- name: image1
  newName: privateregistry/image1
  newTag: TAG1
- name: image2
  newName: privateregistry/image2
  newTag: TAG1
# + more

The registry and TAGS are duplicated.

Is there a way to define a local constant (to a file) to prevent this kind of duplication?

@aodinokov
Copy link
Contributor

@zhech2
Here is the old way of doing de-duplication of data: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/vars/ - most likely will be deprecated, but not clear when.
Here is what is coming (very likely - next release):
#3492

@natasha41575
Copy link
Contributor

natasha41575 commented Apr 23, 2021

Yes, @aodinokov is right. We will deprecate vars and replace it with a replacements field - this will be available next release. It will allow you to copy a field (or part of a field) from one resource to the field (or part of a field) of another resource, or another field of the same resource.

You can see what sorts of things this replacements field will support in the regression tests for the filter here, and our e2e tests here.

You can also see all the fields that will be allowed in a replacement here.

I am working on adding documentation for this feature to the site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants