search by tags

for the user

adventures into the land of the command line

hugo templating with helm

some better references here & here

what’re the hyphens for?

hyphen (-) deletes white space characters. it can be put in the beginning

{{- if blah }}
{{- end }}

or at the end

{{ if blah -}}
{{ end -}}

if there are none, then when the yaml is “compiled”, it will appear to have blank space where these things were. for example:

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
data:
  {{ if blah }}
  something: blah
  {{ end }}
  something-else: blah-again

will become:

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
data:

  something: blah

  something-else: blah-again

if oooor

{{ if or (ne .Values.blah "blah") (ne .Values.blah.again "blah") }}
  something
{{ else }}
  something else
{{ end }}