As indicated in the Helm documentation on operators:
For templates, the operators (eq
, ne
, lt
, gt
, and
, or
and so on) are all implemented as functions. In pipelines, operations can be grouped with parentheses ((
, and )
).
It means you could use
{{- if or (eq .Values.isCar true) (eq .Values.isBus true) }}
Furthermore, as noted in the if/else structure:
A pipeline is evaluated as false if the value is:
- a boolean false
- a numeric zero
- an empty string
- a nil (empty or null)
- an empty collection (map, slice, tuple, dict, array)
Under all other conditions, the condition is true.
If your properties (isCar
and isBus
) are booleans, you can then skip the equal check:
{{- if or .Values.isCar .Values.isBus }}