Anyone tried to make an arithmetic division in Helm?
According to sprig/Math Functions, the following should work:
{{ .Values.myvalue | div 2 }}
However, the result is wrong. e.g. 6/2 = 0
, 4/2 = 0
, 1/2 = 2
.
Any hint ?
On November 13th, 2020 the Stable and Incubator Helm chart repositories will be deprecated and all Helm-related images will no longer be available from GCR.
The $_ is used to suppress undesired output as "set" returns the new dictionary.
trunc 63 truncates it to 63 characters in length.
nindent. The nindent function is the same as the indent function, but prepends a new line to the beginning of the string. nindent 4 $lots_of_text. The above will indent every line of text by 4 space characters and add a new line to the beginning.
You use the function the wrong way: See function declaration.
Your template should be:
{{ div .Values.myvalue 2 }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With