diff --git a/charts/opentelemetry-operator/templates/_helpers.tpl b/charts/opentelemetry-operator/templates/_helpers.tpl index 4d5cba0fd..9d2aeba7e 100644 --- a/charts/opentelemetry-operator/templates/_helpers.tpl +++ b/charts/opentelemetry-operator/templates/_helpers.tpl @@ -30,15 +30,20 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Create Operator version. +*/}} +{{- define "opentelemetry-operator.appVersion" -}} +{{ default .Chart.AppVersion .Values.manager.image.tag }} +{{- end }} + {{/* Common labels */}} {{- define "opentelemetry-operator.labels" -}} helm.sh/chart: {{ include "opentelemetry-operator.chart" . }} {{ include "opentelemetry-operator.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ include "opentelemetry-operator.appVersion" . | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} {{- if .Values.additionalLabels }} @@ -150,7 +155,7 @@ Return the name of the cert-manager.io/inject-ca-from annotation for webhooks an The image to use for opentelemetry-operator. */}} {{- define "opentelemetry-operator.image" -}} -{{- printf "%s:%s" .Values.manager.image.repository (default .Chart.AppVersion .Values.manager.image.tag) }} +{{- printf "%s:%s" .Values.manager.image.repository (include "opentelemetry-operator.appVersion" .) }} {{- end }} {{- define "opentelemetry-operator.featureGatesMap" -}}