Helm Notable Values: Difference between revisions
Jump to navigation
Jump to search
Line 24: | Line 24: | ||
{{ if (eq 0 (int .Values.myValue)) }} | {{ if (eq 0 (int .Values.myValue)) }} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang='yaml'> | |||
{{ printf "%T" .Values.myValue }} | |||
</syntaxhighlight> | |||
returns <code>float64</code> | |||
<syntaxhighlight lang='yaml'> | |||
{{ typeOf .Values.myValue }} | |||
</syntaxhighlight> | |||
returns <code>float64</code> | |||
=Boolean True= | =Boolean True= |
Revision as of 08:32, 5 January 2021
Internal
Numeric Zero
For a numeric zero declared as:
myValue: 0
the following expressions evaluate to false:
Evaluates to false:
{{ if .Values.myValue }}
the following expressions evaluate to true:
{{ if empty .Values.myValue }}
{{ if (eq 0 (int .Values.myValue)) }}
{{ printf "%T" .Values.myValue }}
returns float64
{{ typeOf .Values.myValue }}
returns float64
Boolean True
Boolean False
Empty Value (nil)
myValue:
{{ printf "%T" .Values.myValue }}
returns <nil>
{{ typeOf .Values.myValue }}
returns <nil>