[COMMON] Add version label to be Istio ready
[oom.git] / kubernetes / common / common / templates / _labels.tpl
index f2bd1a1..a690acd 100644 (file)
@@ -27,6 +27,11 @@ The function takes several arguments (inside a dictionary):
 {{- $dot := default . .dot -}}
 app.kubernetes.io/name: {{ include "common.name" $dot }}
 app: {{ include "common.name" $dot }}
+{{- if $dot.Chart.AppVersion }}
+version: "{{ $dot.Chart.AppVersion | replace "+" "_" }}"
+{{- else }}
+version: "{{ $dot.Chart.Version | replace "+" "_" }}"
+{{- end }}
 {{ if not .ignoreHelmChart }}
 helm.sh/chart: {{ include "common.chart" $dot }}
 {{- end }}