Skip to content

Commit

Permalink
fix(opentelemetry-operator): set version label with image tag if prov…
Browse files Browse the repository at this point in the history
…ided (open-telemetry#1461)

* Create app version helper

* Fix description

* Bump version

---------

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
  • Loading branch information
2 people authored and jtyr committed Dec 23, 2024
1 parent 06bfb9f commit e61927e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions charts/opentelemetry-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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" -}}
Expand Down

0 comments on commit e61927e

Please sign in to comment.