UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 03448982 authored by Christopher O'Connell's avatar Christopher O'Connell
Browse files

Merge branch 'kiali-labels-helper' into 'master'

feat: Add kiali labels helper

See merge request !4903
parents b789ea89 6f52d0db
No related branches found
No related tags found
1 merge request!4903feat: Add kiali labels helper
Pipeline #3541775 passed
{{- 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 */ -}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment