From d9e8c23df242dd9a2dda7c3738360928526d7a20 Mon Sep 17 00:00:00 2001 From: Bernd Schorgers Date: Thu, 23 May 2024 14:16:40 +0200 Subject: [PATCH] fix(common): Fix annotations/labels processing --- charts/library/common/Chart.yaml | 4 ++-- charts/library/common/README.md | 4 ++-- charts/library/common/templates/classes/_configmap.tpl | 4 ++-- charts/library/common/templates/classes/_cronjob.tpl | 4 ++-- charts/library/common/templates/classes/_daemonset.tpl | 4 ++-- charts/library/common/templates/classes/_deployment.tpl | 4 ++-- charts/library/common/templates/classes/_ingress.tpl | 4 ++-- charts/library/common/templates/classes/_job.tpl | 4 ++-- charts/library/common/templates/classes/_networkpolicy.tpl | 4 ++-- charts/library/common/templates/classes/_pvc.tpl | 4 ++-- charts/library/common/templates/classes/_route.tpl | 4 ++-- charts/library/common/templates/classes/_secret.tpl | 4 ++-- charts/library/common/templates/classes/_service.tpl | 4 ++-- charts/library/common/templates/classes/_serviceAccount.tpl | 4 ++-- charts/library/common/templates/classes/_serviceMonitor.tpl | 4 ++-- charts/library/common/templates/classes/_statefulset.tpl | 4 ++-- charts/library/common/values.schema.json | 2 +- 17 files changed, 33 insertions(+), 33 deletions(-) diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index 85cbc372..5be93be9 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: common description: Function library for Helm charts type: library -version: 3.2.0 +version: 3.2.1 kubeVersion: ">=1.22.0-0" keywords: - common @@ -16,7 +16,7 @@ annotations: artifacthub.io/changes: |- - kind: added description: |- - Support templating in annotation and label values for all objects + Support templating in annotation and label values for all objects (fixed in v3.2.1) - kind: added description: |- Support activeDeadlineSeconds field on CronJobs and Jobs diff --git a/charts/library/common/README.md b/charts/library/common/README.md index 6d72872d..4fb861d5 100644 --- a/charts/library/common/README.md +++ b/charts/library/common/README.md @@ -1,6 +1,6 @@ # common -![Version: 3.2.0](https://img.shields.io/badge/Version-3.2.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) +![Version: 3.2.1](https://img.shields.io/badge/Version-3.2.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) Function library for Helm charts @@ -27,7 +27,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g. # Chart.yaml dependencies: - name: common - version: 3.2.0 + version: 3.2.1 repository: https://bjw-s.github.io/helm-charts/ ``` diff --git a/charts/library/common/templates/classes/_configmap.tpl b/charts/library/common/templates/classes/_configmap.tpl index 58c07851..f0ed645a 100644 --- a/charts/library/common/templates/classes/_configmap.tpl +++ b/charts/library/common/templates/classes/_configmap.tpl @@ -22,13 +22,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} data: diff --git a/charts/library/common/templates/classes/_cronjob.tpl b/charts/library/common/templates/classes/_cronjob.tpl index 7df4b60d..ad2b9c8a 100644 --- a/charts/library/common/templates/classes/_cronjob.tpl +++ b/charts/library/common/templates/classes/_cronjob.tpl @@ -30,13 +30,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_daemonset.tpl b/charts/library/common/templates/classes/_daemonset.tpl index 60269aee..ad97acdb 100644 --- a/charts/library/common/templates/classes/_daemonset.tpl +++ b/charts/library/common/templates/classes/_daemonset.tpl @@ -23,13 +23,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_deployment.tpl b/charts/library/common/templates/classes/_deployment.tpl index f618fd4f..95816a04 100644 --- a/charts/library/common/templates/classes/_deployment.tpl +++ b/charts/library/common/templates/classes/_deployment.tpl @@ -23,13 +23,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_ingress.tpl b/charts/library/common/templates/classes/_ingress.tpl index 73c6a84d..6bb1857a 100644 --- a/charts/library/common/templates/classes/_ingress.tpl +++ b/charts/library/common/templates/classes/_ingress.tpl @@ -23,13 +23,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_job.tpl b/charts/library/common/templates/classes/_job.tpl index fd22a13c..309b01e6 100644 --- a/charts/library/common/templates/classes/_job.tpl +++ b/charts/library/common/templates/classes/_job.tpl @@ -25,13 +25,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_networkpolicy.tpl b/charts/library/common/templates/classes/_networkpolicy.tpl index 0f68bd08..efd5da46 100644 --- a/charts/library/common/templates/classes/_networkpolicy.tpl +++ b/charts/library/common/templates/classes/_networkpolicy.tpl @@ -32,13 +32,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_pvc.tpl b/charts/library/common/templates/classes/_pvc.tpl index b8c6d2ef..cca40a82 100644 --- a/charts/library/common/templates/classes/_pvc.tpl +++ b/charts/library/common/templates/classes/_pvc.tpl @@ -29,13 +29,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_route.tpl b/charts/library/common/templates/classes/_route.tpl index bc7b3bbc..a524bd2a 100644 --- a/charts/library/common/templates/classes/_route.tpl +++ b/charts/library/common/templates/classes/_route.tpl @@ -30,13 +30,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_secret.tpl b/charts/library/common/templates/classes/_secret.tpl index 4dffb7e3..4b67b024 100644 --- a/charts/library/common/templates/classes/_secret.tpl +++ b/charts/library/common/templates/classes/_secret.tpl @@ -30,13 +30,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $stringData }} diff --git a/charts/library/common/templates/classes/_service.tpl b/charts/library/common/templates/classes/_service.tpl index 74576831..cb17c96c 100644 --- a/charts/library/common/templates/classes/_service.tpl +++ b/charts/library/common/templates/classes/_service.tpl @@ -25,13 +25,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_serviceAccount.tpl b/charts/library/common/templates/classes/_serviceAccount.tpl index dfaf9b33..068d1e18 100644 --- a/charts/library/common/templates/classes/_serviceAccount.tpl +++ b/charts/library/common/templates/classes/_serviceAccount.tpl @@ -22,13 +22,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} secrets: diff --git a/charts/library/common/templates/classes/_serviceMonitor.tpl b/charts/library/common/templates/classes/_serviceMonitor.tpl index 53467423..90ccb6c7 100644 --- a/charts/library/common/templates/classes/_serviceMonitor.tpl +++ b/charts/library/common/templates/classes/_serviceMonitor.tpl @@ -17,13 +17,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/templates/classes/_statefulset.tpl b/charts/library/common/templates/classes/_statefulset.tpl index 6ac1a538..70679555 100644 --- a/charts/library/common/templates/classes/_statefulset.tpl +++ b/charts/library/common/templates/classes/_statefulset.tpl @@ -23,13 +23,13 @@ metadata: {{- with $labels }} labels: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} {{- with $annotations }} annotations: {{- range $key, $value := . }} - {{ $key }}: {{ tpl $value $rootContext }} + {{- printf "%s: %s" $key (tpl $value $rootContext | toYaml ) | nindent 4 }} {{- end }} {{- end }} spec: diff --git a/charts/library/common/values.schema.json b/charts/library/common/values.schema.json index 4ea561e6..2acdadde 100644 --- a/charts/library/common/values.schema.json +++ b/charts/library/common/values.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.2.0/charts/library/common/values.schema.json", + "$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.2.1/charts/library/common/values.schema.json", "type": "object", "properties": {