From 5739f5c83429cdfc28dc8ffcc965f13073ddf223 Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Wed, 10 Jan 2024 10:20:05 +0100 Subject: [PATCH 1/2] fix: add missing labels to resources otherwise upgrades fail with `resource already exists, add missing labels` --- .../openstack-cloud-controller-manager/Chart.yaml | 8 ++++++-- .../templates/_helpers.tpl | 13 ------------- .../templates/clusterrole.yaml | 1 + .../templates/clusterrolebinding-sm.yaml | 1 + .../templates/clusterrolebinding.yaml | 1 + .../templates/daemonset.yaml | 3 +-- .../templates/secret.yaml | 1 + .../templates/service-sm.yaml | 3 +-- .../templates/serviceaccount.yaml | 1 + .../templates/servicemonitor.yaml | 3 +-- 10 files changed, 14 insertions(+), 21 deletions(-) diff --git a/charts/openstack-cloud-controller-manager/Chart.yaml b/charts/openstack-cloud-controller-manager/Chart.yaml index ff39ef84e9..2b0742a891 100644 --- a/charts/openstack-cloud-controller-manager/Chart.yaml +++ b/charts/openstack-cloud-controller-manager/Chart.yaml @@ -1,11 +1,15 @@ -apiVersion: v1 +apiVersion: v2 appVersion: v1.29.0 description: Openstack Cloud Controller Manager Helm Chart icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png home: https://github.com/kubernetes/cloud-provider-openstack name: openstack-cloud-controller-manager -version: 2.29.0 +version: 2.29.0-1 maintainers: - name: eumel8 email: f.kloeker@telekom.de url: https://www.telekom.com +dependencies: + - name: common + version: 2.14.1 + repository: https://charts.bitnami.com/bitnami diff --git a/charts/openstack-cloud-controller-manager/templates/_helpers.tpl b/charts/openstack-cloud-controller-manager/templates/_helpers.tpl index 098dc0b378..411e157324 100644 --- a/charts/openstack-cloud-controller-manager/templates/_helpers.tpl +++ b/charts/openstack-cloud-controller-manager/templates/_helpers.tpl @@ -12,19 +12,6 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{/* -Common labels and app labels -*/}} -{{- define "occm.labels" -}} -app.kubernetes.io/name: {{ include "occm.name" . }} -helm.sh/chart: {{ include "occm.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} - {{- define "occm.common.matchLabels" -}} app: {{ template "occm.name" . }} release: {{ .Release.Name }} diff --git a/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml b/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml index 6786931f41..cf03f8a11a 100644 --- a/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml +++ b/charts/openstack-cloud-controller-manager/templates/clusterrole.yaml @@ -2,6 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ .Values.clusterRoleName }} + labels: {{- include "common.labels.standard" . | nindent 4 }} annotations: {{- with .Values.commonAnnotations }} {{- toYaml . | nindent 4 }} diff --git a/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml b/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml index 88d9aedf6e..f2ee6ac5f1 100644 --- a/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml +++ b/charts/openstack-cloud-controller-manager/templates/clusterrolebinding-sm.yaml @@ -3,6 +3,7 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system:{{ include "occm.name" . }}:auth-delegate + labels: {{- include "common.labels.standard" . | nindent 4 }} annotations: {{- with .Values.commonAnnotations }} {{- toYaml . | nindent 4 }} diff --git a/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml b/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml index a572710908..62906bfbca 100644 --- a/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml +++ b/charts/openstack-cloud-controller-manager/templates/clusterrolebinding.yaml @@ -3,6 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ .Values.clusterRoleName }} + labels: {{- include "common.labels.standard" . | nindent 4 }} annotations: {{- with .Values.commonAnnotations }} {{- toYaml . | nindent 4 }} diff --git a/charts/openstack-cloud-controller-manager/templates/daemonset.yaml b/charts/openstack-cloud-controller-manager/templates/daemonset.yaml index 1808dee94f..1d1b74d66c 100644 --- a/charts/openstack-cloud-controller-manager/templates/daemonset.yaml +++ b/charts/openstack-cloud-controller-manager/templates/daemonset.yaml @@ -2,9 +2,8 @@ apiVersion: apps/v1 kind: DaemonSet metadata: name: {{ include "occm.name" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} namespace: {{ .Release.Namespace }} - labels: - {{- include "occm.labels" . | nindent 4 }} annotations: {{- with .Values.commonAnnotations }} {{- toYaml . | nindent 4 }} diff --git a/charts/openstack-cloud-controller-manager/templates/secret.yaml b/charts/openstack-cloud-controller-manager/templates/secret.yaml index 66c6352ea3..b745fa25f6 100644 --- a/charts/openstack-cloud-controller-manager/templates/secret.yaml +++ b/charts/openstack-cloud-controller-manager/templates/secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ .Values.secret.name | default "cloud-config" }} + labels: {{- include "common.labels.standard" . | nindent 4 }} namespace: {{ .Release.Namespace }} annotations: {{- with .Values.commonAnnotations }} diff --git a/charts/openstack-cloud-controller-manager/templates/service-sm.yaml b/charts/openstack-cloud-controller-manager/templates/service-sm.yaml index 30ae3fe9de..92b07f865e 100644 --- a/charts/openstack-cloud-controller-manager/templates/service-sm.yaml +++ b/charts/openstack-cloud-controller-manager/templates/service-sm.yaml @@ -2,9 +2,8 @@ apiVersion: v1 kind: Service metadata: - labels: - {{- include "occm.labels" . | nindent 4 }} name: {{ include "occm.name" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} namespace: {{ .Release.Namespace }} annotations: {{- with .Values.commonAnnotations }} diff --git a/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml b/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml index f97f1c8a65..dfac2b15fa 100644 --- a/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml +++ b/charts/openstack-cloud-controller-manager/templates/serviceaccount.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ .Values.serviceAccountName }} + labels: {{- include "common.labels.standard" . | nindent 4 }} namespace: {{ .Release.Namespace }} annotations: {{- with .Values.commonAnnotations }} diff --git a/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml b/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml index 2e728add50..1663fb3b56 100644 --- a/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml +++ b/charts/openstack-cloud-controller-manager/templates/servicemonitor.yaml @@ -2,9 +2,8 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - labels: - {{- include "occm.labels" . | nindent 4 }} name: {{ include "occm.name" . }} + labels: {{- include "common.labels.standard" . | nindent 4 }} namespace: {{ .Release.Namespace }} annotations: {{- with .Values.commonAnnotations }} From ffe6abb5d33e3da6fb021ef2369ba49f88c251bc Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Mon, 22 Jan 2024 12:16:02 +0100 Subject: [PATCH 2/2] chore: bump version --- charts/openstack-cloud-controller-manager/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/openstack-cloud-controller-manager/Chart.yaml b/charts/openstack-cloud-controller-manager/Chart.yaml index 2b0742a891..d7065b9f55 100644 --- a/charts/openstack-cloud-controller-manager/Chart.yaml +++ b/charts/openstack-cloud-controller-manager/Chart.yaml @@ -4,7 +4,7 @@ description: Openstack Cloud Controller Manager Helm Chart icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png home: https://github.com/kubernetes/cloud-provider-openstack name: openstack-cloud-controller-manager -version: 2.29.0-1 +version: 2.29.1 maintainers: - name: eumel8 email: f.kloeker@telekom.de