From 2ac1ad8501533a5d552cb012be0571b25f916d15 Mon Sep 17 00:00:00 2001 From: Juan Ariza Toledano Date: Tue, 29 Aug 2023 09:51:38 +0200 Subject: [PATCH] [bitnami/harbor] Support for customizing standard labels (#18537) --- bitnami/harbor/Chart.yaml | 2 +- .../templates/core/core-cm-envvars.yaml | 5 +--- bitnami/harbor/templates/core/core-cm.yaml | 5 +--- .../core/core-config-override-secret.yaml | 5 +--- bitnami/harbor/templates/core/core-dpl.yaml | 20 +++++---------- .../templates/core/core-secret-envvars.yaml | 5 +--- .../harbor/templates/core/core-secret.yaml | 5 +--- bitnami/harbor/templates/core/core-svc.yaml | 8 +++--- .../exporter/exporter-cm-envvars.yaml | 5 +--- .../templates/exporter/exporter-dpl.yaml | 20 +++++---------- .../exporter/exporter-secret-envvars.yaml | 5 +--- .../templates/exporter/exporter-svc.yaml | 8 +++--- .../templates/ingress/core-ingress.yaml | 13 +++------- .../templates/ingress/notary-ingress.yaml | 14 +++-------- .../harbor/templates/ingress/tls-secret.yaml | 20 +++------------ .../internal/internal-crt-secret.yaml | 25 ++++--------------- .../jobservice/jobservice-cm-envvars.yaml | 5 +--- .../jobservice/jobservice-config-secret.yaml | 6 ++--- .../templates/jobservice/jobservice-dpl.yaml | 20 +++++---------- .../templates/jobservice/jobservice-pvc.yaml | 13 +++------- .../jobservice/jobservice-scandata-pvc.yaml | 13 +++------- .../jobservice/jobservice-secret-envvars.yaml | 5 +--- .../jobservice/jobservice-secrets.yaml | 5 +--- .../templates/jobservice/jobservice-svc.yaml | 8 +++--- .../templates/metrics/metrics-svcmonitor.yaml | 11 +++----- .../templates/nginx/configmap-http.yaml | 5 +--- .../templates/nginx/configmap-https.yaml | 5 +--- .../harbor/templates/nginx/deployment.yaml | 20 +++++---------- bitnami/harbor/templates/nginx/service.yaml | 19 ++++++-------- .../harbor/templates/nginx/tls-secret.yaml | 5 +--- .../notary/notary-secret-envvars.yaml | 5 +--- .../templates/notary/notary-secret.yaml | 5 +--- .../templates/notary/notary-server.yaml | 20 +++++---------- .../templates/notary/notary-signer.yaml | 20 +++++---------- .../harbor/templates/notary/notary-svc.yaml | 18 ++++++------- .../harbor/templates/portal/portal-cm.yaml | 5 +--- .../harbor/templates/portal/portal-dpl.yaml | 20 +++++---------- .../harbor/templates/portal/portal-svc.yaml | 9 +++---- .../templates/registry/registry-cm.yaml | 5 +--- .../registry/registry-ctl-cm-envvars.yaml | 5 +--- .../templates/registry/registry-dpl.yaml | 20 +++++---------- .../templates/registry/registry-pvc.yaml | 13 +++------- .../templates/registry/registry-secret.yaml | 5 +--- .../templates/registry/registry-svc.yaml | 9 +++---- .../templates/trivy/trivy-cm-envvars.yaml | 5 +--- .../templates/trivy/trivy-secret-envvars.yaml | 5 +--- bitnami/harbor/templates/trivy/trivy-sts.yaml | 22 ++++++---------- bitnami/harbor/templates/trivy/trivy-svc.yaml | 8 +++--- 48 files changed, 146 insertions(+), 358 deletions(-) diff --git a/bitnami/harbor/Chart.yaml b/bitnami/harbor/Chart.yaml index 2b2660a51d..b4dd64d168 100644 --- a/bitnami/harbor/Chart.yaml +++ b/bitnami/harbor/Chart.yaml @@ -59,4 +59,4 @@ maintainers: name: harbor sources: - https://github.com/bitnami/charts/tree/main/bitnami/harbor -version: 17.0.0 +version: 17.1.0 diff --git a/bitnami/harbor/templates/core/core-cm-envvars.yaml b/bitnami/harbor/templates/core/core-cm-envvars.yaml index 1a4b30350d..d6db7650ca 100644 --- a/bitnami/harbor/templates/core/core-cm-envvars.yaml +++ b/bitnami/harbor/templates/core/core-cm-envvars.yaml @@ -10,10 +10,7 @@ kind: ConfigMap metadata: name: {{ printf "%s-envvars" (include "harbor.core" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/core/core-cm.yaml b/bitnami/harbor/templates/core/core-cm.yaml index c88c1c89b5..7f42480d48 100644 --- a/bitnami/harbor/templates/core/core-cm.yaml +++ b/bitnami/harbor/templates/core/core-cm.yaml @@ -8,10 +8,7 @@ kind: ConfigMap metadata: name: {{ include "harbor.core" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/core/core-config-override-secret.yaml b/bitnami/harbor/templates/core/core-config-override-secret.yaml index 94dd9c4725..2e4158ae1c 100644 --- a/bitnami/harbor/templates/core/core-config-override-secret.yaml +++ b/bitnami/harbor/templates/core/core-config-override-secret.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ printf "%s-config-override" (include "harbor.core" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/core/core-dpl.yaml b/bitnami/harbor/templates/core/core-dpl.yaml index e74057bd2d..60e59c587c 100644 --- a/bitnami/harbor/templates/core/core-dpl.yaml +++ b/bitnami/harbor/templates/core/core-dpl.yaml @@ -8,31 +8,23 @@ kind: Deployment metadata: name: {{ include "harbor.core" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.core.replicaCount }} + {{- $podLabels := merge .Values.core.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: core {{- if .Values.core.updateStrategy }} strategy: {{- toYaml .Values.core.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.matchLabels" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.core.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.core.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: core annotations: checksum/configmap: {{ include (print $.Template.BasePath "/core/core-cm.yaml") . | sha256sum }} @@ -56,8 +48,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.core.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.core.podAffinityPreset "component" "core" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.core.podAntiAffinityPreset "component" "core" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.core.podAffinityPreset "component" "core" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.core.podAntiAffinityPreset "component" "core" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.core.nodeAffinityPreset.type "key" .Values.core.nodeAffinityPreset.key "values" .Values.core.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.core.nodeSelector }} diff --git a/bitnami/harbor/templates/core/core-secret-envvars.yaml b/bitnami/harbor/templates/core/core-secret-envvars.yaml index 4ba382ac54..cbb792b48f 100644 --- a/bitnami/harbor/templates/core/core-secret-envvars.yaml +++ b/bitnami/harbor/templates/core/core-secret-envvars.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ printf "%s-envvars" (include "harbor.core" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/core/core-secret.yaml b/bitnami/harbor/templates/core/core-secret.yaml index 74b737bf48..be93397bb8 100644 --- a/bitnami/harbor/templates/core/core-secret.yaml +++ b/bitnami/harbor/templates/core/core-secret.yaml @@ -8,10 +8,7 @@ kind: Secret metadata: name: {{ include "harbor.core" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/core/core-svc.yaml b/bitnami/harbor/templates/core/core-svc.yaml index 88a1f76027..313a4e9080 100644 --- a/bitnami/harbor/templates/core/core-svc.yaml +++ b/bitnami/harbor/templates/core/core-svc.yaml @@ -8,10 +8,7 @@ kind: Service metadata: name: {{ include "harbor.core" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} @@ -29,5 +26,6 @@ spec: port: {{ .Values.core.service.ports.metrics }} targetPort: metrics {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.core.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core diff --git a/bitnami/harbor/templates/exporter/exporter-cm-envvars.yaml b/bitnami/harbor/templates/exporter/exporter-cm-envvars.yaml index 9c08566d07..ab7ccadbee 100644 --- a/bitnami/harbor/templates/exporter/exporter-cm-envvars.yaml +++ b/bitnami/harbor/templates/exporter/exporter-cm-envvars.yaml @@ -9,10 +9,7 @@ kind: ConfigMap metadata: name: {{ include "harbor.exporter" . }}-envvars namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: exporter {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/exporter/exporter-dpl.yaml b/bitnami/harbor/templates/exporter/exporter-dpl.yaml index e1b79c32b3..b6231402e4 100644 --- a/bitnami/harbor/templates/exporter/exporter-dpl.yaml +++ b/bitnami/harbor/templates/exporter/exporter-dpl.yaml @@ -9,31 +9,23 @@ kind: Deployment metadata: name: {{ include "harbor.exporter" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: exporter {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.exporter.replicaCount }} + {{- $podLabels := merge .Values.exporter.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: exporter {{- if .Values.exporter.updateStrategy }} strategy: {{- toYaml .Values.exporter.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.matchLabels" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.exporter.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.exporter.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: exporter annotations: checksum/configmap-env: {{ include (print $.Template.BasePath "/exporter/exporter-cm-envvars.yaml") . | sha256sum }} @@ -54,8 +46,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.exporter.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.exporter.podAffinityPreset "component" "exporter" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.exporter.podAntiAffinityPreset "component" "exporter" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.exporter.podAffinityPreset "component" "exporter" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.exporter.podAntiAffinityPreset "component" "exporter" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.exporter.nodeAffinityPreset.type "key" .Values.exporter.nodeAffinityPreset.key "values" .Values.exporter.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.exporter.nodeSelector }} diff --git a/bitnami/harbor/templates/exporter/exporter-secret-envvars.yaml b/bitnami/harbor/templates/exporter/exporter-secret-envvars.yaml index eafa806fb8..ec56bec26c 100644 --- a/bitnami/harbor/templates/exporter/exporter-secret-envvars.yaml +++ b/bitnami/harbor/templates/exporter/exporter-secret-envvars.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ include "harbor.exporter" . }}-envvars namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: exporter {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/exporter/exporter-svc.yaml b/bitnami/harbor/templates/exporter/exporter-svc.yaml index 5009f1adfd..e703288ac7 100644 --- a/bitnami/harbor/templates/exporter/exporter-svc.yaml +++ b/bitnami/harbor/templates/exporter/exporter-svc.yaml @@ -9,10 +9,7 @@ kind: Service metadata: name: "{{ template "harbor.exporter" . }}" namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: exporter {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} @@ -22,6 +19,7 @@ spec: - name: http-metrics port: {{ .Values.exporter.service.ports.metrics }} targetPort: metrics - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.exporter.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: exporter {{ end }} diff --git a/bitnami/harbor/templates/ingress/core-ingress.yaml b/bitnami/harbor/templates/ingress/core-ingress.yaml index d2a2ec2df1..8f75dee035 100644 --- a/bitnami/harbor/templates/ingress/core-ingress.yaml +++ b/bitnami/harbor/templates/ingress/core-ingress.yaml @@ -31,10 +31,7 @@ kind: Ingress metadata: name: {{ include "harbor.ingress" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} annotations: {{- if .Values.internalTLS.enabled }} nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" @@ -45,11 +42,9 @@ metadata: ncp/http-redirect: "true" {{- end }} {{- end }} - {{- if .Values.ingress.core.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.ingress.core.annotations "context" .) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + {{- if or .Values.ingress.core.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.ingress.core.annotations .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: {{- if eq .Values.ingress.core.controller "ncp" }} diff --git a/bitnami/harbor/templates/ingress/notary-ingress.yaml b/bitnami/harbor/templates/ingress/notary-ingress.yaml index 37cb81a26f..08bbc0fbcf 100644 --- a/bitnami/harbor/templates/ingress/notary-ingress.yaml +++ b/bitnami/harbor/templates/ingress/notary-ingress.yaml @@ -9,16 +9,10 @@ kind: Ingress metadata: name: {{ include "harbor.ingress-notary" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.ingress.notary.annotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.ingress.notary.annotations "context" .) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" .) | nindent 4 }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- if or .Values.ingress.notary.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.ingress.notary.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: {{- if eq .Values.ingress.notary.controller "ncp" }} diff --git a/bitnami/harbor/templates/ingress/tls-secret.yaml b/bitnami/harbor/templates/ingress/tls-secret.yaml index a35b8b8245..d4398329cd 100644 --- a/bitnami/harbor/templates/ingress/tls-secret.yaml +++ b/bitnami/harbor/templates/ingress/tls-secret.yaml @@ -11,10 +11,7 @@ kind: Secret metadata: name: {{ .name }} namespace: {{ $.Release.Namespace | quote }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }} {{- if $.Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -32,10 +29,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -53,10 +47,7 @@ kind: Secret metadata: name: {{ .name }} namespace: {{ $.Release.Namespace | quote }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }} {{- if $.Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -74,10 +65,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/harbor/templates/internal/internal-crt-secret.yaml b/bitnami/harbor/templates/internal/internal-crt-secret.yaml index 8b84301961..80f68eb2a9 100644 --- a/bitnami/harbor/templates/internal/internal-crt-secret.yaml +++ b/bitnami/harbor/templates/internal/internal-crt-secret.yaml @@ -15,10 +15,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: core type: kubernetes.io/tls data: @@ -36,10 +33,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice type: kubernetes.io/tls data: @@ -57,10 +51,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: registry type: kubernetes.io/tls data: @@ -78,10 +69,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: portal type: kubernetes.io/tls data: @@ -99,10 +87,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: trivy type: kubernetes.io/tls data: diff --git a/bitnami/harbor/templates/jobservice/jobservice-cm-envvars.yaml b/bitnami/harbor/templates/jobservice/jobservice-cm-envvars.yaml index eb237bd5ac..8f05514625 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-cm-envvars.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-cm-envvars.yaml @@ -8,10 +8,7 @@ kind: ConfigMap metadata: name: {{ printf "%s-envvars" (include "harbor.jobservice" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/jobservice/jobservice-config-secret.yaml b/bitnami/harbor/templates/jobservice/jobservice-config-secret.yaml index b667dab0ac..854875d954 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-config-secret.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-config-secret.yaml @@ -8,10 +8,8 @@ kind: Secret metadata: name: {{ include "harbor.jobservice" . }}-config namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: jobservice {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/jobservice/jobservice-dpl.yaml b/bitnami/harbor/templates/jobservice/jobservice-dpl.yaml index eb0ce96dec..6df2bd24d0 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-dpl.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-dpl.yaml @@ -8,31 +8,23 @@ kind: Deployment metadata: name: {{ include "harbor.jobservice" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.jobservice.replicaCount }} + {{- $podLabels := merge .Values.jobservice.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: jobservice {{- if .Values.jobservice.updateStrategy }} strategy: {{- toYaml .Values.jobservice.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.jobservice.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.jobservice.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: jobservice annotations: checksum/configmap-env: {{ include (print $.Template.BasePath "/jobservice/jobservice-cm-envvars.yaml") . | sha256sum }} @@ -56,8 +48,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.jobservice.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobservice.podAffinityPreset "component" "jobservice" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobservice.podAntiAffinityPreset "component" "jobservice" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobservice.podAffinityPreset "component" "jobservice" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.jobservice.podAntiAffinityPreset "component" "jobservice" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.jobservice.nodeAffinityPreset.type "key" .Values.jobservice.nodeAffinityPreset.key "values" .Values.jobservice.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.jobservice.nodeSelector }} diff --git a/bitnami/harbor/templates/jobservice/jobservice-pvc.yaml b/bitnami/harbor/templates/jobservice/jobservice-pvc.yaml index cc96c788a2..bc4816914e 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-pvc.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-pvc.yaml @@ -10,20 +10,15 @@ apiVersion: v1 metadata: name: {{ include "harbor.jobservice" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice annotations: {{- if eq .Values.persistence.resourcePolicy "keep" }} helm.sh/resource-policy: keep {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.persistence.persistentVolumeClaim.jobservice.annotations }} - {{- toYaml .Values.persistence.persistentVolumeClaim.jobservice.annotations | nindent 4 }} + {{- if or .Values.persistence.persistentVolumeClaim.jobservice.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.persistence.persistentVolumeClaim.jobservice.annotations .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: accessModes: diff --git a/bitnami/harbor/templates/jobservice/jobservice-scandata-pvc.yaml b/bitnami/harbor/templates/jobservice/jobservice-scandata-pvc.yaml index ba20390ff9..b1ab64c023 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-scandata-pvc.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-scandata-pvc.yaml @@ -9,20 +9,15 @@ apiVersion: v1 metadata: name: {{ include "harbor.jobserviceScanData" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice annotations: {{- if eq .Values.persistence.resourcePolicy "keep" }} helm.sh/resource-policy: keep {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.persistence.persistentVolumeClaim.jobservice.scanData.annotations }} - {{- toYaml .Values.persistence.persistentVolumeClaim.jobservice.scanData.annotations | nindent 4 }} + {{- if or .Values.persistence.persistentVolumeClaim.jobservice.scanData.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.persistence.persistentVolumeClaim.jobservice.scanData.annotations .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: accessModes: diff --git a/bitnami/harbor/templates/jobservice/jobservice-secret-envvars.yaml b/bitnami/harbor/templates/jobservice/jobservice-secret-envvars.yaml index 6e110c8b50..5f1de97159 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-secret-envvars.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-secret-envvars.yaml @@ -8,10 +8,7 @@ kind: Secret metadata: name: {{ printf "%s-envvars" (include "harbor.jobservice" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/jobservice/jobservice-secrets.yaml b/bitnami/harbor/templates/jobservice/jobservice-secrets.yaml index df1530a516..ea8f6e3629 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-secrets.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-secrets.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ include "harbor.jobservice" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/jobservice/jobservice-svc.yaml b/bitnami/harbor/templates/jobservice/jobservice-svc.yaml index 1758d378c0..c70b19024e 100644 --- a/bitnami/harbor/templates/jobservice/jobservice-svc.yaml +++ b/bitnami/harbor/templates/jobservice/jobservice-svc.yaml @@ -8,10 +8,7 @@ kind: Service metadata: name: {{ include "harbor.jobservice" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} @@ -26,5 +23,6 @@ spec: port: {{ .Values.jobservice.service.ports.metrics }} targetPort: metrics {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.jobservice.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: jobservice diff --git a/bitnami/harbor/templates/metrics/metrics-svcmonitor.yaml b/bitnami/harbor/templates/metrics/metrics-svcmonitor.yaml index e062437095..7089eb30a7 100644 --- a/bitnami/harbor/templates/metrics/metrics-svcmonitor.yaml +++ b/bitnami/harbor/templates/metrics/metrics-svcmonitor.yaml @@ -9,13 +9,8 @@ kind: ServiceMonitor metadata: name: {{ include "common.names.fullname" . }} namespace: {{ default .Release.Namespace .Values.metrics.serviceMonitor.namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.labels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.labels "context" $) | nindent 4 }} - {{- end }} + {{- $labels := merge .Values.metrics.serviceMonitor.labels .Values.commonLabels }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} app.kubernetes.io/component: metrics {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} @@ -25,7 +20,7 @@ spec: jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }} {{- end }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} {{- if .Values.metrics.serviceMonitor.selector }} {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} {{- end }} diff --git a/bitnami/harbor/templates/nginx/configmap-http.yaml b/bitnami/harbor/templates/nginx/configmap-http.yaml index ceedd97b76..87b09fe414 100644 --- a/bitnami/harbor/templates/nginx/configmap-http.yaml +++ b/bitnami/harbor/templates/nginx/configmap-http.yaml @@ -10,10 +10,7 @@ kind: ConfigMap metadata: name: {{ include "harbor.nginx" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: nginx {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/nginx/configmap-https.yaml b/bitnami/harbor/templates/nginx/configmap-https.yaml index c7b616294b..7e298b0839 100644 --- a/bitnami/harbor/templates/nginx/configmap-https.yaml +++ b/bitnami/harbor/templates/nginx/configmap-https.yaml @@ -10,10 +10,7 @@ kind: ConfigMap metadata: name: {{ include "harbor.nginx" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: nginx {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/nginx/deployment.yaml b/bitnami/harbor/templates/nginx/deployment.yaml index 2f877927fd..20cf4c496f 100644 --- a/bitnami/harbor/templates/nginx/deployment.yaml +++ b/bitnami/harbor/templates/nginx/deployment.yaml @@ -9,31 +9,23 @@ kind: Deployment metadata: name: {{ include "harbor.nginx" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: nginx {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.nginx.replicaCount }} + {{- $podLabels := merge .Values.nginx.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: nginx {{- if .Values.nginx.updateStrategy }} strategy: {{- toYaml .Values.nginx.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.nginx.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.nginx.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: nginx annotations: {{- if not .Values.nginx.tls.enabled }} @@ -56,8 +48,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.nginx.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.nginx.podAffinityPreset "component" "nginx" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.nginx.podAntiAffinityPreset "component" "nginx" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.nginx.podAffinityPreset "component" "nginx" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.nginx.podAntiAffinityPreset "component" "nginx" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nginx.nodeAffinityPreset.type "key" .Values.nginx.nodeAffinityPreset.key "values" .Values.nginx.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.nginx.nodeSelector }} diff --git a/bitnami/harbor/templates/nginx/service.yaml b/bitnami/harbor/templates/nginx/service.yaml index 5eb8d95be0..317b339ef2 100644 --- a/bitnami/harbor/templates/nginx/service.yaml +++ b/bitnami/harbor/templates/nginx/service.yaml @@ -9,18 +9,12 @@ kind: Service metadata: name: {{ include "common.names.fullname" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: nginx - annotations: - {{- if .Values.service.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- if or .Values.service.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.service.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} {{- if and .Values.service.clusterIP (eq .Values.service.type "ClusterIP") }} @@ -73,6 +67,7 @@ spec: {{- if .Values.service.extraPorts }} {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }} {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.nginx.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: nginx {{- end }} diff --git a/bitnami/harbor/templates/nginx/tls-secret.yaml b/bitnami/harbor/templates/nginx/tls-secret.yaml index 9cda667db0..8edd655395 100644 --- a/bitnami/harbor/templates/nginx/tls-secret.yaml +++ b/bitnami/harbor/templates/nginx/tls-secret.yaml @@ -12,10 +12,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: nginx {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/notary/notary-secret-envvars.yaml b/bitnami/harbor/templates/notary/notary-secret-envvars.yaml index 56d5b8f0c3..10b221c8db 100644 --- a/bitnami/harbor/templates/notary/notary-secret-envvars.yaml +++ b/bitnami/harbor/templates/notary/notary-secret-envvars.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ printf "%s-envvars" (include "harbor.notary-server" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: notary {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/notary/notary-secret.yaml b/bitnami/harbor/templates/notary/notary-secret.yaml index 70f7562d50..9370bd2f03 100644 --- a/bitnami/harbor/templates/notary/notary-secret.yaml +++ b/bitnami/harbor/templates/notary/notary-secret.yaml @@ -10,10 +10,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: notary {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/notary/notary-server.yaml b/bitnami/harbor/templates/notary/notary-server.yaml index 35a5988a4b..65b333fd5a 100644 --- a/bitnami/harbor/templates/notary/notary-server.yaml +++ b/bitnami/harbor/templates/notary/notary-server.yaml @@ -9,31 +9,23 @@ kind: Deployment metadata: name: {{ include "harbor.notary-server" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: notary-server {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.notary.server.replicaCount }} + {{- $podLabels := merge .Values.notary.server.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: notary-server {{- if .Values.notary.server.updateStrategy }} strategy: {{- toYaml .Values.notary.server.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.notary.server.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.notary.server.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: notary-server annotations: checksum/secret: {{ include (print $.Template.BasePath "/notary/notary-secret.yaml") . | sha256sum }} @@ -51,8 +43,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.notary.server.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.server.podAffinityPreset "component" "notary-server" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.server.podAntiAffinityPreset "component" "notary-server" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.server.podAffinityPreset "component" "notary-server" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.server.podAntiAffinityPreset "component" "notary-server" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.notary.server.nodeAffinityPreset.type "key" .Values.notary.server.nodeAffinityPreset.key "values" .Values.notary.server.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.notary.server.nodeSelector }} diff --git a/bitnami/harbor/templates/notary/notary-signer.yaml b/bitnami/harbor/templates/notary/notary-signer.yaml index 66dc92710a..1e396db05d 100644 --- a/bitnami/harbor/templates/notary/notary-signer.yaml +++ b/bitnami/harbor/templates/notary/notary-signer.yaml @@ -9,31 +9,23 @@ kind: Deployment metadata: name: {{ include "harbor.notary-signer" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: notary-signer {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.notary.signer.replicaCount }} + {{- $podLabels := merge .Values.notary.signer.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: notary-signer {{- if .Values.notary.signer.updateStrategy }} strategy: {{- toYaml .Values.notary.signer.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.notary.signer.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.notary.signer.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: notary-signer annotations: checksum/secret: {{ include (print $.Template.BasePath "/notary/notary-secret.yaml") . | sha256sum }} @@ -50,8 +42,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.notary.signer.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.signer.podAffinityPreset "component" "notary-signer" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.signer.podAntiAffinityPreset "component" "notary-signer" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.signer.podAffinityPreset "component" "notary-signer" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.notary.signer.podAntiAffinityPreset "component" "notary-signer" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.notary.signer.nodeAffinityPreset.type "key" .Values.notary.signer.nodeAffinityPreset.key "values" .Values.notary.signer.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.notary.signer.nodeSelector }} diff --git a/bitnami/harbor/templates/notary/notary-svc.yaml b/bitnami/harbor/templates/notary/notary-svc.yaml index b5af5bfb1f..46fa2913e3 100644 --- a/bitnami/harbor/templates/notary/notary-svc.yaml +++ b/bitnami/harbor/templates/notary/notary-svc.yaml @@ -9,10 +9,8 @@ kind: Service metadata: name: {{ include "harbor.notary-server" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: notary-server {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -24,17 +22,16 @@ spec: - name: notary-server port: {{ .Values.notary.service.ports.server }} targetPort: notary-server - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $serverPodLabels := merge .Values.notary.server.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $serverPodLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: notary-server --- apiVersion: v1 kind: Service metadata: name: {{ include "harbor.notary-signer" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: notary-signer {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -43,6 +40,7 @@ spec: - name: notary-signer port: {{ .Values.notary.service.ports.signer }} targetPort: notary-signer - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $signerPodLabels := merge .Values.notary.signer.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $signerPodLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: notary-signer {{- end }} diff --git a/bitnami/harbor/templates/portal/portal-cm.yaml b/bitnami/harbor/templates/portal/portal-cm.yaml index b1e4e644ce..8c96cfa710 100644 --- a/bitnami/harbor/templates/portal/portal-cm.yaml +++ b/bitnami/harbor/templates/portal/portal-cm.yaml @@ -9,10 +9,7 @@ kind: ConfigMap metadata: name: {{ include "harbor.portal" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: portal {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/portal/portal-dpl.yaml b/bitnami/harbor/templates/portal/portal-dpl.yaml index 25603d029c..c4949d2e35 100644 --- a/bitnami/harbor/templates/portal/portal-dpl.yaml +++ b/bitnami/harbor/templates/portal/portal-dpl.yaml @@ -8,31 +8,23 @@ kind: Deployment metadata: name: {{ include "harbor.portal" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: portal {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.portal.replicaCount }} + {{- $podLabels := merge .Values.portal.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: portal {{- if .Values.portal.updateStrategy }} strategy: {{- toYaml .Values.portal.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.portal.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.portal.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: portal annotations: {{- if and .Values.internalTLS.enabled (not .Values.portal.tls.existingSecret) }} @@ -51,8 +43,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.portal.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.portal.podAffinityPreset "component" "portal" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.portal.podAntiAffinityPreset "component" "portal" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.portal.podAffinityPreset "component" "portal" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.portal.podAntiAffinityPreset "component" "portal" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.portal.nodeAffinityPreset.type "key" .Values.portal.nodeAffinityPreset.key "values" .Values.portal.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.portal.nodeSelector }} diff --git a/bitnami/harbor/templates/portal/portal-svc.yaml b/bitnami/harbor/templates/portal/portal-svc.yaml index 6b9fafcd31..b295265837 100644 --- a/bitnami/harbor/templates/portal/portal-svc.yaml +++ b/bitnami/harbor/templates/portal/portal-svc.yaml @@ -8,10 +8,8 @@ kind: Service metadata: name: {{ include "harbor.portal" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: portal {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -23,5 +21,6 @@ spec: - name: {{ ternary "https" "http" .Values.internalTLS.enabled }} port: {{ ternary .Values.portal.service.ports.https .Values.portal.service.ports.http .Values.internalTLS.enabled }} targetPort: {{ ternary "https" "http" .Values.internalTLS.enabled }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.portal.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: portal diff --git a/bitnami/harbor/templates/registry/registry-cm.yaml b/bitnami/harbor/templates/registry/registry-cm.yaml index 1bcd07ab1d..6f1dfade54 100644 --- a/bitnami/harbor/templates/registry/registry-cm.yaml +++ b/bitnami/harbor/templates/registry/registry-cm.yaml @@ -8,10 +8,7 @@ kind: ConfigMap metadata: name: {{ include "harbor.registry" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/harbor/templates/registry/registry-ctl-cm-envvars.yaml b/bitnami/harbor/templates/registry/registry-ctl-cm-envvars.yaml index e5af1148f0..d24f3604ce 100644 --- a/bitnami/harbor/templates/registry/registry-ctl-cm-envvars.yaml +++ b/bitnami/harbor/templates/registry/registry-ctl-cm-envvars.yaml @@ -9,10 +9,7 @@ kind: ConfigMap metadata: name: {{ printf "%s-ctl-envvars" (include "harbor.registry" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: registry {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/registry/registry-dpl.yaml b/bitnami/harbor/templates/registry/registry-dpl.yaml index 8745a05048..b21f07ebfc 100644 --- a/bitnami/harbor/templates/registry/registry-dpl.yaml +++ b/bitnami/harbor/templates/registry/registry-dpl.yaml @@ -8,31 +8,23 @@ kind: Deployment metadata: name: {{ include "harbor.registry" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: registry {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: replicas: {{ .Values.registry.replicaCount }} + {{- $podLabels := merge .Values.registry.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: registry {{- if .Values.registry.updateStrategy }} strategy: {{- toYaml .Values.registry.updateStrategy | nindent 4 }} {{- end }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.registry.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.registry.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: registry annotations: checksum/configmap: {{ include (print $.Template.BasePath "/registry/registry-cm.yaml") . | sha256sum }} @@ -55,8 +47,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.registry.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.registry.podAffinityPreset "component" "registry" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.registry.podAntiAffinityPreset "component" "registry" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.registry.podAffinityPreset "component" "registry" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.registry.podAntiAffinityPreset "component" "registry" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.registry.nodeAffinityPreset.type "key" .Values.registry.nodeAffinityPreset.key "values" .Values.registry.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.registry.nodeSelector }} diff --git a/bitnami/harbor/templates/registry/registry-pvc.yaml b/bitnami/harbor/templates/registry/registry-pvc.yaml index 3e2ca8d917..e071efb21b 100644 --- a/bitnami/harbor/templates/registry/registry-pvc.yaml +++ b/bitnami/harbor/templates/registry/registry-pvc.yaml @@ -10,20 +10,15 @@ apiVersion: v1 metadata: name: {{ include "harbor.registry" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: registry annotations: {{- if eq .Values.persistence.resourcePolicy "keep" }} helm.sh/resource-policy: keep {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.persistence.persistentVolumeClaim.registry.annotations }} - {{- toYaml .Values.persistence.persistentVolumeClaim.registry.annotations | nindent 4 }} + {{- if or .Values.persistence.persistentVolumeClaim.registry.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.persistence.persistentVolumeClaim.registry.annotations .Values.commonAnnotations }} + {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: accessModes: diff --git a/bitnami/harbor/templates/registry/registry-secret.yaml b/bitnami/harbor/templates/registry/registry-secret.yaml index 0bf290dd38..59012d4907 100644 --- a/bitnami/harbor/templates/registry/registry-secret.yaml +++ b/bitnami/harbor/templates/registry/registry-secret.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ include "harbor.registry" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} diff --git a/bitnami/harbor/templates/registry/registry-svc.yaml b/bitnami/harbor/templates/registry/registry-svc.yaml index 58da72ab96..e9700844a9 100644 --- a/bitnami/harbor/templates/registry/registry-svc.yaml +++ b/bitnami/harbor/templates/registry/registry-svc.yaml @@ -8,10 +8,8 @@ kind: Service metadata: name: {{ include "harbor.registry" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + app.kubernetes.io/component: registry {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} @@ -26,5 +24,6 @@ spec: port: {{ .Values.registry.server.service.ports.metrics }} targetPort: metrics {{- end }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.registry.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: registry diff --git a/bitnami/harbor/templates/trivy/trivy-cm-envvars.yaml b/bitnami/harbor/templates/trivy/trivy-cm-envvars.yaml index 0241b2c0b1..64b2ddace9 100644 --- a/bitnami/harbor/templates/trivy/trivy-cm-envvars.yaml +++ b/bitnami/harbor/templates/trivy/trivy-cm-envvars.yaml @@ -8,10 +8,7 @@ kind: ConfigMap metadata: name: {{ printf "%s-envvars" (include "harbor.trivy" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: trivy {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/trivy/trivy-secret-envvars.yaml b/bitnami/harbor/templates/trivy/trivy-secret-envvars.yaml index 0222c20e3a..e780b65ca2 100644 --- a/bitnami/harbor/templates/trivy/trivy-secret-envvars.yaml +++ b/bitnami/harbor/templates/trivy/trivy-secret-envvars.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ printf "%s-envvars" (include "harbor.trivy" .) }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: trivy {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} diff --git a/bitnami/harbor/templates/trivy/trivy-sts.yaml b/bitnami/harbor/templates/trivy/trivy-sts.yaml index b6daac2eb0..6b6e34e7e0 100644 --- a/bitnami/harbor/templates/trivy/trivy-sts.yaml +++ b/bitnami/harbor/templates/trivy/trivy-sts.yaml @@ -9,10 +9,7 @@ kind: StatefulSet metadata: name: {{ include "harbor.trivy" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: trivy {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} @@ -21,18 +18,13 @@ spec: replicas: {{ .Values.trivy.replicaCount }} serviceName: {{ template "harbor.trivy" . }} updateStrategy: {{- toYaml .Values.trivy.updateStrategy | nindent 4 }} + {{- $podLabels := merge .Values.trivy.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} app.kubernetes.io/component: trivy template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }} - {{- end }} - {{- if .Values.trivy.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.trivy.podLabels "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} app.kubernetes.io/component: trivy annotations: checksum/configmap-env: {{ include (print $.Template.BasePath "/trivy/trivy-cm-envvars.yaml") . | sha256sum }} @@ -52,8 +44,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.trivy.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.trivy.podAffinityPreset "component" "trivy" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.trivy.podAntiAffinityPreset "component" "trivy" "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.trivy.podAffinityPreset "component" "trivy" "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.trivy.podAntiAffinityPreset "component" "trivy" "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.trivy.nodeAffinityPreset.type "key" .Values.trivy.nodeAffinityPreset.key "values" .Values.trivy.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.trivy.nodeSelector }} @@ -209,7 +201,7 @@ spec: volumeClaimTemplates: - metadata: name: data - labels: {{- include "common.labels.matchLabels" . | nindent 10 }} + labels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 10 }} {{- if .Values.persistence.persistentVolumeClaim.trivy.annotations }} annotations: {{- toYaml .Values.persistence.persistentVolumeClaim.trivy.annotations | nindent 10 }} {{- end }} diff --git a/bitnami/harbor/templates/trivy/trivy-svc.yaml b/bitnami/harbor/templates/trivy/trivy-svc.yaml index 7c1709943a..b6fee74841 100644 --- a/bitnami/harbor/templates/trivy/trivy-svc.yaml +++ b/bitnami/harbor/templates/trivy/trivy-svc.yaml @@ -9,10 +9,7 @@ kind: Service metadata: name: {{ include "harbor.trivy" . }} namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: trivy {{- if .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} @@ -23,6 +20,7 @@ spec: protocol: TCP port: {{ ternary .Values.trivy.service.ports.https .Values.trivy.service.ports.http .Values.internalTLS.enabled }} targetPort: api-server - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := merge .Values.trivy.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} app.kubernetes.io/component: trivy {{ end }}