From 0fe2873594c91be59f435813174e4bacf7d1e59d Mon Sep 17 00:00:00 2001 From: Martin Reinhardt Date: Mon, 29 Jan 2024 18:33:04 +0100 Subject: [PATCH] fix(Helm): Correcting mapping issues for labels --- charts/keycloak-reporter/Chart.yaml | 2 +- charts/keycloak-reporter/README.md | 2 +- charts/keycloak-reporter/ci.values.yaml | 5 +++++ charts/keycloak-reporter/templates/_helpers.tpl | 13 +++++++++++++ charts/keycloak-reporter/templates/cronjob.yaml | 16 ++++++++-------- .../templates/tests/test-connection.yaml | 10 +++------- charts/keycloak-reporter/values.yaml | 2 +- keycloak-reporter-1.3.0.tgz | Bin 0 -> 3983 bytes 8 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 keycloak-reporter-1.3.0.tgz diff --git a/charts/keycloak-reporter/Chart.yaml b/charts/keycloak-reporter/Chart.yaml index a3fb11e1..cc5e1d93 100644 --- a/charts/keycloak-reporter/Chart.yaml +++ b/charts/keycloak-reporter/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.0 +version: 1.3.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/keycloak-reporter/README.md b/charts/keycloak-reporter/README.md index 823c1a11..53b78a20 100644 --- a/charts/keycloak-reporter/README.md +++ b/charts/keycloak-reporter/README.md @@ -1,6 +1,6 @@ # keycloak-reporter -![Version: 1.3.0](https://img.shields.io/badge/Version-1.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.7](https://img.shields.io/badge/AppVersion-0.8.7-informational?style=flat-square) +![Version: 1.3.1](https://img.shields.io/badge/Version-1.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.7](https://img.shields.io/badge/AppVersion-0.8.7-informational?style=flat-square) Keycloak user and client reporting tool for automated regular access checks. diff --git a/charts/keycloak-reporter/ci.values.yaml b/charts/keycloak-reporter/ci.values.yaml index 1f161daf..713722e4 100644 --- a/charts/keycloak-reporter/ci.values.yaml +++ b/charts/keycloak-reporter/ci.values.yaml @@ -6,6 +6,11 @@ env: secretKeyRef: key: clientSecret name: kc-reporter +podLabels: + a: "b" +podAnnotations: + # see https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover-hints.html + co.elastic.logs/enabled: "true" keycloak: config: url: http://localhost:8080 diff --git a/charts/keycloak-reporter/templates/_helpers.tpl b/charts/keycloak-reporter/templates/_helpers.tpl index 79be102a..6a66feef 100755 --- a/charts/keycloak-reporter/templates/_helpers.tpl +++ b/charts/keycloak-reporter/templates/_helpers.tpl @@ -30,6 +30,16 @@ 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 +*/}} +{{- define "keycloak-reporter.annotations" -}} +net.cst.kc-reporter/config-checksum: {{ include (print $.Template.BasePath "/secret.yaml") $ | sha256sum }} +{{- range $k, $v := .Values.podAnnotations }} +{{ $k }}: {{ $v | quote }} +{{- end }} +{{- end }} + {{/* Common labels */}} @@ -40,6 +50,9 @@ helm.sh/chart: {{ include "keycloak-reporter.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- range $k, $v := .Values.podLabels }} +{{ $k }}: {{ $v | quote }} +{{- end }} {{- end }} {{/* diff --git a/charts/keycloak-reporter/templates/cronjob.yaml b/charts/keycloak-reporter/templates/cronjob.yaml index adc7c349..eec92928 100644 --- a/charts/keycloak-reporter/templates/cronjob.yaml +++ b/charts/keycloak-reporter/templates/cronjob.yaml @@ -4,19 +4,19 @@ apiVersion: batch/v1 kind: CronJob metadata: name: {{ printf "%s-job-%s" $fullName $name }} + annotations: + {{- include "keycloak-reporter.annotations" $ | nindent 4 }} + labels: + {{- include "keycloak-reporter.labels" $ | nindent 4 }} spec: schedule: {{ $config.schedule }} jobTemplate: spec: template: - {{- with $.Values.podAnnotations }} annotations: - {{- toYaml $ | nindent 10 }} - {{- end }} - {{- with $.Values.podLabels }} - label: - {{- toYaml $ | nindent 10 }} - {{- end }} + {{- include "keycloak-reporter.annotations" $ | nindent 8 }} + labels: + {{- include "keycloak-reporter.labels" $ | nindent 8 }} spec: {{- with $.Values.imagePullSecrets }} imagePullSecrets: @@ -73,4 +73,4 @@ spec: claimName: {{ $fullName }}-reports {{- end }} --- -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/charts/keycloak-reporter/templates/tests/test-connection.yaml b/charts/keycloak-reporter/templates/tests/test-connection.yaml index e1c83ea2..f0dd8257 100644 --- a/charts/keycloak-reporter/templates/tests/test-connection.yaml +++ b/charts/keycloak-reporter/templates/tests/test-connection.yaml @@ -7,13 +7,9 @@ metadata: helm.sh/hook: test helm.sh/hook-delete-policy: "hook-succeeded,before-hook-creation" helm.sh/hook-weight: "5" - {{- with $.Values.podAnnotations }} - {{- toYaml $ | nindent 10 }} - {{- end }} - {{- with $.Values.podLabels }} - label: - {{- toYaml $ | nindent 10 }} - {{- end }} + {{- include "keycloak-reporter.annotations" . | nindent 4 }} + labels: + {{- include "keycloak-reporter.labels" . | nindent 4 }} spec: containers: - name: config-test diff --git a/charts/keycloak-reporter/values.yaml b/charts/keycloak-reporter/values.yaml index b1d4c49e..2877ab89 100644 --- a/charts/keycloak-reporter/values.yaml +++ b/charts/keycloak-reporter/values.yaml @@ -8,7 +8,7 @@ image: repository: continuoussecuritytooling/keycloak-reporting-cli pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: '' imagePullSecrets: [] nameOverride: '' diff --git a/keycloak-reporter-1.3.0.tgz b/keycloak-reporter-1.3.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..0e3903c6fb34082169dec3586252c479bd01acec GIT binary patch literal 3983 zcmV;A4{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