Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(opentelemetry-operator): set version label with image tag if provided #1461

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/opentelemetry-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: opentelemetry-operator
version: 0.60.0
version: 0.60.1
description: OpenTelemetry Operator Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -91,7 +91,7 @@ metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand All @@ -30,7 +30,7 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -223,7 +223,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand All @@ -242,7 +242,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand All @@ -26,7 +26,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -34,7 +34,7 @@ spec:
- --enable-leader-election
- --health-probe-addr=:8081
- --webhook-port=9443
- --collector-image=otel/opentelemetry-collector-k8s:0.100.0
- --collector-image=otel/opentelemetry-collector-k8s:0.100.1
command:
- /manager
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -32,7 +32,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: opentelemetry-operator
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: "example-opentelemetry-operator-cert-manager"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: "example-opentelemetry-operator-metrics"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -44,7 +44,7 @@ metadata:
name: "example-opentelemetry-operator-webhook"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.60.0
helm.sh/chart: opentelemetry-operator-0.60.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.100.1"
app.kubernetes.io/managed-by: Helm
Expand Down
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 }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.Chart.AppVersion will be always defined so its not needed

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 }}
{{ include "opentelemetry-operator.additionalLabels" . }}
Expand Down Expand Up @@ -147,5 +152,5 @@ 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 }}
2 changes: 1 addition & 1 deletion charts/opentelemetry-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ manager:
tag: ""
collectorImage:
repository: ""
tag: 0.100.0
tag: 0.100.1
TylerHelmuth marked this conversation as resolved.
Show resolved Hide resolved
opampBridgeImage:
repository: ""
tag: ""
Expand Down