Skip to content

Commit

Permalink
fix(opentelemetry-operator): ensure valid version label (#1483)
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Parent <[email protected]>
  • Loading branch information
sathieu authored Jan 8, 2025
1 parent ee64f22 commit 2d8972d
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 38 deletions.
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.78.0
version: 0.78.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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -90,7 +90,7 @@ metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -29,7 +29,7 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -222,7 +222,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -240,7 +240,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -25,7 +25,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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: Role
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -31,7 +31,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -43,7 +43,7 @@ metadata:
name: "example-opentelemetry-operator-webhook"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -90,7 +90,7 @@ metadata:
annotations:
cert-manager.io/inject-ca-from: default/example-opentelemetry-operator-serving-cert
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -29,7 +29,7 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -256,7 +256,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -274,7 +274,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -25,7 +25,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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: Role
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand All @@ -31,7 +31,7 @@ apiVersion: v1
kind: Service
metadata:
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
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.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand Down Expand Up @@ -43,7 +43,7 @@ metadata:
name: "example-opentelemetry-operator-webhook"
namespace: default
labels:
helm.sh/chart: opentelemetry-operator-0.78.0
helm.sh/chart: opentelemetry-operator-0.78.1
app.kubernetes.io/name: opentelemetry-operator
app.kubernetes.io/version: "0.116.0"
app.kubernetes.io/managed-by: Helm
Expand Down
10 changes: 9 additions & 1 deletion charts/opentelemetry-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,21 @@ Create Operator version.
{{ default .Chart.AppVersion .Values.manager.image.tag }}
{{- end }}

{{/*
Enforce valid label value.
See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
*/}}
{{- define "opentelemetry-operator.validLabelValue" -}}
{{- (regexReplaceAllLiteral "[^a-zA-Z0-9._-]" . "-") | trunc 63 | trimSuffix "-" | trimSuffix "_" | trimSuffix "." }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "opentelemetry-operator.labels" -}}
helm.sh/chart: {{ include "opentelemetry-operator.chart" . }}
{{ include "opentelemetry-operator.selectorLabels" . }}
app.kubernetes.io/version: {{ include "opentelemetry-operator.appVersion" . | quote }}
app.kubernetes.io/version: {{ include "opentelemetry-operator.validLabelValue" (include "opentelemetry-operator.appVersion" .) | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.additionalLabels }}
Expand Down

0 comments on commit 2d8972d

Please sign in to comment.