How to negate an evaluation/expression in helm?

Viewed 6739

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 }}
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) }}
Related