What is The Purpose Of Dash Inside Curly Braces In Helm Template

Helm’s template internally uses Golang template language. In Go template, dash is used in curly braces to skip white-space around it.

Let’s take an example. Suppose {{$test}} evaluates to “ok”.

1

{{$test}}

2

will be rendered as

1

ok

2

1

{{- $test}}

2

will be rendered as

1ok

2

1

{{$test -}}

2

will be rendered as

1

ok2

1

{{- $test -}}

2

will be rendered as

1ok2


Leave a Comment