diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index a972c4d62aec28a689642b276d129906937dfd33..35b8ee354bdf1d250a6a2e8c20e4035e5a1fd321 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -1,5 +1,5 @@ {{- define "values-bigbang" -}} -{{- /* +{{- /* * bigbang.values-bigbang: Produce a stripped version of the bigbang variables * in the root namespace suitable for inclusion in wrapper or package variables definitions */ -}} @@ -170,23 +170,23 @@ stringData: {{- toYaml .package.values | nindent 4 }} {{- end -}} -{{/* +{{/* bigbang.addValueIfSet can be used to nil check parameters before adding them to the values. Expects a list with the following params: * [0] - (string) <yaml_key_to_add> * [1] - (interface{}) <value_to_check> - - No output is generated if <value> is undefined, however, explicitly set empty values + + No output is generated if <value> is undefined, however, explicitly set empty values (i.e. `username=""`) will be passed along. All string fields will be quoted. - Example command: + Example command: - `{{ (list "name" .username) | include "bigbang.addValueIfSet" }}` * When `username: Aniken` -> `name: "Aniken"` * When `username: ""` -> `name: ""` * When username is not defined - -> no output + -> no output */}} {{- define "bigbang.addValueIfSet" -}} {{- $key := (index . 0) }} @@ -195,20 +195,20 @@ bigbang.addValueIfSet can be used to nil check parameters before adding them to {{- if not (kindIs "invalid" $value) }} {{- /*Handle strings*/}} {{- if kindIs "string" $value }} - {{- printf "\n%s" $key }}: {{ $value | quote }} + {{- printf "\n%s" $key }}: {{ $value | quote }} {{- /*Hanldle slices*/}} {{- else if kindIs "slice" $value }} - {{- printf "\n%s" $key }}: + {{- printf "\n%s" $key }}: {{- range $value }} {{- if kindIs "string" . }} {{- printf "\n - %s" (. | quote) }} - {{- else }} + {{- else }} {{- printf "\n - %v" . }} {{- end }} {{- end }} {{- /*Handle other types (no quotes)*/}} {{- else }} - {{- printf "\n%s" $key }}: {{ $value }} + {{- printf "\n%s" $key }}: {{ $value }} {{- end }} {{- end }} {{- end -}} @@ -230,6 +230,28 @@ bigbang.dev/istioVersion: {{ .Values.istio.helmRepo.tag }}{{ if .Values.istio.en {{- end -}} {{- end -}} +{{/* +App Label for Kiali trace correlation +To be used for Kiali-required labels on pods +This will: + * enable proper linking of Jaeger traces in Kiali + * enable full Kiali label tracking of pods +*/}} +{{- define "kialiAppLabel" -}} +app: {{ "{{ .Chart.Name }}" | quote }} +{{- end -}} + +{{/* +Version label for Kiali trace correlation +To be used for Kiali-required labels on pods +This will: + * enable proper linking of Jaeger traces in Kiali + * enable full Kiali label tracking of pods +*/}} +{{- define "kialiVersionLabel" -}} +version: {{ "{{ .Chart.AppVersion }}" | quote }} +{{- end -}} + {{- /* Helpers below this line are in support of the Big Bang extensibility feature */ -}} {{- /* Converts the string in . to a legal Kubernetes resource name */ -}}