This is an example of the syntax of GO template, what is done here:
- Make
$domainvariable with an empty value. - Make
$nsvariables with values derivedNAMESPACEEnvironmental variable. So, we need to fill it first to make logic function. For exampleexport NAMESPACE=staging. - Logic / IF-ELSE Conditional to check equality (
eq) from$ns. printfFunction for a combination of string.
{{ $domain := "" }}
{{ $ns := env "NAMESPACE" -}}
{{ if eq $ns "staging" -}}
{{ $domain = printf ".%s.svc.cluster.local:2200" $ns }}
{{ else -}}
{{ $domain = printf ".%s.svc.cluster.local:2200" $ns }}
{{ end }}
Admin Lukmanlab, Devops engineer, site reliability engineer, system administrator.
Review Film
Berita Terkini
Berita Terkini
Berita Terkini
review anime
Gaming Center
Berita Olahraga
Lowongan Kerja
Berita Terkini
Berita Terbaru
Berita Teknologi
Seputar Teknologi
Berita Politik
Resep Masakan
Pendidikan
Comments are closed, but trackbacks and pingbacks are open.