fresh-yak-35965
07/17/2024, 2:14 PM${!var.message}
. How else would I express "when var.message is undefined"?microscopic-river-74022
07/17/2024, 2:14 PMmicroscopic-river-74022
07/17/2024, 2:14 PM?
after the template to allow it to resolve to an undefined value without throwing an error. For example, ${var.message}?
. This is useful when you don't want to provide any value unless one is explicitly set.
Here's an example:
yaml
kind: Project
providers:
- name: kubernetes
kubeconfig: ${var.kubeconfig}?
In this case, kubeconfig
will not be set unless var.kubeconfig
is explicitly set.
However, the documentation does not mention the use of a bang (!
) to negate or check for undefined values in template strings. It's recommended to follow the documented syntax to avoid unexpected behavior.
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
07/17/2024, 2:14 PM