Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to negate an evaluation/expression in helm?

I have bash commands that copies files and folders to a target directory. After all files/folders are copied, I need to check if I need to delete a specific folder. If false, delete the directory. In helm, how do I negate the boolean true or false

Something like:

{{- if not .Values.copyExamples }}
    --delete the files
{{- end }}
like image 327
alltej Avatar asked Dec 14 '25 12:12

alltej


1 Answers

You can negate a test on a single value using the simple syntax:

{{- if not .Values.ssl.upstream }}

If you need to negate the result of a comparison then you can also do that:

{{- if not (contains "test" $env) }}
like image 112
Andy Brown Avatar answered Dec 16 '25 23:12

Andy Brown



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!