Helm Template If/Else: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 8: Line 8:




<tt>if</tt>/<tt>else</tt> can be used to create conditional blocks.
<tt>if</tt>/<tt>else</tt> can be used to create conditional blocks.  


<font color=darkgray>TODO.</font>
The if control structures evaluate pipelines, not just values (values are a special case of a pipeline):
 
<syntaxhighlight lang='yaml'>
{{ if PIPELINE }}
  # Do something
{{ else if OTHER_PIPELINE }}
  # Do something else
{{ else }}
  # Default case
{{ end }}
</syntaxhighlight>

Revision as of 20:14, 9 October 2019

External

Internal

Overview

if/else can be used to create conditional blocks.

The if control structures evaluate pipelines, not just values (values are a special case of a pipeline):

{{ if PIPELINE }}
  # Do something
{{ else if OTHER_PIPELINE }}
  # Do something else
{{ else }}
  # Default case
{{ end }}