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

Add a CLI flag to override the custom Zarf variables #489

Closed
YrrepNoj opened this issue May 23, 2022 · 4 comments · Fixed by #621
Closed

Add a CLI flag to override the custom Zarf variables #489

YrrepNoj opened this issue May 23, 2022 · 4 comments · Fixed by #621
Labels
enhancement ✨ New feature or request

Comments

@YrrepNoj
Copy link
Contributor

Right now we can define custom variables for the components that gets templated to the manifests/helm charts that the component uses. Currently, the value has to be defined in the zarf.yaml when the package is built.

An example of custom component variables is in this example


kind: ZarfPackageConfig
metadata:
  name: component-variables
  description: "Test component to demonstrate script timeout feature"

components:
  # Demonstrates injecting custom variables into a K8s resource, e.g. ###ZARF_DOG###
  - name: variable-example
    required: true
    variables:
      dog: "woof"
      cat: "meow"
    manifests:
      - name: variable-example-configmap
        files:
          - simple-configmap.yaml


It would be very useful to be able to provide the values for the custom variables during runtime. Something like zarf package deploy --values dog=woof2.

NOTE: Right now the custom variables are component specific, this means that (at the current moment at least) the custom variable names do not need to be unique throughout that package. That might need to change depending on how the solution to this issue gets implemented.

@YrrepNoj
Copy link
Contributor Author

When this feature request was being discussed, it was pointed out that this feature would make it a lot easier to to rotate around passwords and certs of deployed packages.

@jeff-mccoy
Copy link
Contributor

I think https://www.terraform.io/language/values/variables#variable-definition-precedence has a lot of well-established patterns around doing runtime based variable overrides.

@jeff-mccoy jeff-mccoy added the enhancement ✨ New feature or request label May 23, 2022
@dsmithbauer
Copy link
Contributor

Lol. We were just discussing the need for this exact feature again today on my team. I had even searched the open issues earlier this morning before this was written. I'd love to see this feature implemented as it would save having to repackage just to change some variables and eliminate the need to maintain different packages for different targets where the only difference is a few variables too. +1

@anoncam
Copy link

anoncam commented Jul 15, 2022

@jeff-mccoy this you have access to this, I'll be finding the appropriate ones for a zarf initial set of modules and open source that repo

Repository owner moved this from New Requests to Done in Zarf Project Board Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants