glamorous-kangaroo-20427
10/19/2024, 3:07 PMmicroscopic-river-74022
10/19/2024, 3:07 PMmicroscopic-river-74022
10/19/2024, 3:07 PMif
statement in your configuration and one branch is not permitted, you can use a template string that will resolve to an undefined value in that branch. This will cause an error to be thrown and Garden will stop.
Here is an example of how you can use a template string in your configuration:
yaml
kind: Project
providers:
- name: kubernetes
kubeconfig: ${var.kubeconfig}
In this example, if var.kubeconfig
is not defined, Garden will throw an error and stop.
However, please note that if you want to allow a template string to resolve to an undefined value without throwing an error, you can do so by adding a ?
after the template, like so:
yaml
kind: Project
providers:
- name: kubernetes
kubeconfig: ${var.kubeconfig}?
In this case, if var.kubeconfig
is not defined, no error will be thrown and Garden will continue with the default value for the field in question.
For more information, you can refer to the Garden documentation on variables and templating ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/19/2024, 3:07 PM