Given a YAML
file and go
templates, I can assign a variable with:
{{ $foo := "bar" }}
And I can use a conditional like:
{{ if eq $foo "bar" }} jim {{ else }} bob {{ end }}
How do I combine the two to assign the result of a condition to a variable?
I've tried:
{{ $foo := "bar" }}
{{ if eq $foo "bar" }}
{{ $foo = "jim" }}
{{ else }}
{{ $foo = "bob" }}
{{ end }}
But foo
remains bar