mirror of https://git.rancher.io/charts
Add lookup for existing label value
parent
42258bb807
commit
76e6f9e49f
|
@ -1,6 +1,23 @@
|
|||
--- charts-original/templates/_helpers.tpl
|
||||
+++ charts/templates/_helpers.tpl
|
||||
@@ -176,3 +176,11 @@
|
||||
@@ -50,8 +50,15 @@
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "kiali-server.selectorLabels" -}}
|
||||
+{{- $releaseName := .Release.Name -}}
|
||||
+{{- $fullName := include "kiali-server.fullname" . -}}
|
||||
+{{- $deployment := (lookup "apps/v1" "Deployment" .Release.Namespace $fullName) -}}
|
||||
app.kubernetes.io/name: kiali
|
||||
-app.kubernetes.io/instance: {{ include "kiali-server.fullname" . }}
|
||||
+{{- if (and .Release.IsUpgrade $deployment)}}
|
||||
+app.kubernetes.io/instance: {{ (get (($deployment).metadata.labels) "app.kubernetes.io/instance") | default $fullName }}
|
||||
+{{- else }}
|
||||
+app.kubernetes.io/instance: {{ $fullName }}
|
||||
+{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
@@ -176,3 +183,11 @@
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in New Issue