From 91b2b0981c65b4a708e044ebb2cdd660473d3605 Mon Sep 17 00:00:00 2001 From: Juan Ariza Toledano Date: Thu, 24 Aug 2023 10:09:10 +0200 Subject: [PATCH] [bitnami/gitea] Support for customizing standard labels (#18486) --- bitnami/gitea/Chart.lock | 8 +++--- bitnami/gitea/Chart.yaml | 2 +- bitnami/gitea/templates/deployment.yaml | 27 +++++++------------ .../gitea/templates/externaldb-secrets.yaml | 5 +++- bitnami/gitea/templates/ingress.yaml | 14 +++------- bitnami/gitea/templates/pv.yaml | 5 +--- bitnami/gitea/templates/pvc.yaml | 14 +++------- bitnami/gitea/templates/secrets.yaml | 5 +--- bitnami/gitea/templates/service-account.yaml | 16 ++++------- bitnami/gitea/templates/svc.yaml | 17 ++++-------- bitnami/gitea/templates/tls-secrets.yaml | 10 ++----- 11 files changed, 38 insertions(+), 85 deletions(-) diff --git a/bitnami/gitea/Chart.lock b/bitnami/gitea/Chart.lock index 241be4ae13..22bde5ffd3 100644 --- a/bitnami/gitea/Chart.lock +++ b/bitnami/gitea/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts - version: 12.8.4 + version: 12.9.0 - name: common repository: oci://registry-1.docker.io/bitnamicharts - version: 2.8.0 -digest: sha256:65b63c6b08bf749c3458d21a9d167b2e69591444975f592164c9c70dc72a0ac8 -generated: "2023-08-21T16:46:22.920112769Z" + version: 2.9.0 +digest: sha256:3e3373b4d5b1b1fce1711b2f257e9e2414ef3287484581210a7a9f044d872943 +generated: "2023-08-23T12:43:52.202306+02:00" diff --git a/bitnami/gitea/Chart.yaml b/bitnami/gitea/Chart.yaml index 158890656e..628267cf3e 100644 --- a/bitnami/gitea/Chart.yaml +++ b/bitnami/gitea/Chart.yaml @@ -37,4 +37,4 @@ maintainers: name: gitea sources: - https://github.com/bitnami/charts/tree/main/bitnami/gitea -version: 0.3.9 +version: 0.4.0 diff --git a/bitnami/gitea/templates/deployment.yaml b/bitnami/gitea/templates/deployment.yaml index b8c69165c2..d777900895 100644 --- a/bitnami/gitea/templates/deployment.yaml +++ b/bitnami/gitea/templates/deployment.yaml @@ -8,33 +8,24 @@ kind: Deployment metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.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 }} spec: + {{- $podLabels := merge .Values.podLabels .Values.commonLabels }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} {{- if .Values.updateStrategy }} strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} {{- end }} replicas: {{ .Values.replicaCount }} 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.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - annotations: - {{- if .Values.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} + {{- if .Values.podAnnotations }} + annotations: {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} + {{- end }} spec: {{- include "gitea.imagePullSecrets" . | nindent 6 }} serviceAccountName: {{ include "gitea.serviceAccountName" . }} @@ -45,8 +36,8 @@ spec: affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} {{- else }} affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} + podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "customLabels" $podLabels "context" $) | nindent 10 }} + podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "customLabels" $podLabels "context" $) | nindent 10 }} nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} {{- end }} {{- if .Values.schedulerName }} diff --git a/bitnami/gitea/templates/externaldb-secrets.yaml b/bitnami/gitea/templates/externaldb-secrets.yaml index b7adc7f147..da9fe15e92 100644 --- a/bitnami/gitea/templates/externaldb-secrets.yaml +++ b/bitnami/gitea/templates/externaldb-secrets.yaml @@ -9,7 +9,10 @@ kind: Secret metadata: name: "{{ include "common.names.fullname" . }}-externaldb" namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} + 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 }} type: Opaque data: db-password: {{ default "" .Values.externalDatabase.password | b64enc | quote }} diff --git a/bitnami/gitea/templates/ingress.yaml b/bitnami/gitea/templates/ingress.yaml index fdcc0e8a5b..a857b332f6 100644 --- a/bitnami/gitea/templates/ingress.yaml +++ b/bitnami/gitea/templates/ingress.yaml @@ -9,18 +9,10 @@ kind: Ingress metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.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 or .Values.ingress.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.ingress.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.ingress.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: {{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }} diff --git a/bitnami/gitea/templates/pv.yaml b/bitnami/gitea/templates/pv.yaml index 0bfe502dbb..fe570ce17d 100644 --- a/bitnami/gitea/templates/pv.yaml +++ b/bitnami/gitea/templates/pv.yaml @@ -9,10 +9,7 @@ kind: PersistentVolume metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.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/gitea/templates/pvc.yaml b/bitnami/gitea/templates/pvc.yaml index d61b11675b..15d9ab0fc2 100644 --- a/bitnami/gitea/templates/pvc.yaml +++ b/bitnami/gitea/templates/pvc.yaml @@ -9,18 +9,10 @@ apiVersion: v1 metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.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 or .Values.persistence.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.persistence.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.persistence.annotations "context" $ ) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.persistence.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: {{- if .Values.persistence.hostPath }} diff --git a/bitnami/gitea/templates/secrets.yaml b/bitnami/gitea/templates/secrets.yaml index ebf004deb8..a6fe3ac8dc 100644 --- a/bitnami/gitea/templates/secrets.yaml +++ b/bitnami/gitea/templates/secrets.yaml @@ -9,10 +9,7 @@ kind: Secret metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.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/gitea/templates/service-account.yaml b/bitnami/gitea/templates/service-account.yaml index 526a2aadb9..f79cdccebe 100644 --- a/bitnami/gitea/templates/service-account.yaml +++ b/bitnami/gitea/templates/service-account.yaml @@ -9,16 +9,10 @@ kind: ServiceAccount metadata: name: {{ include "gitea.serviceAccountName" . }} 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.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.serviceAccount.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }} + {{- $annotations := merge .Values.serviceAccount.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} + {{- end }} automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} {{- end }} diff --git a/bitnami/gitea/templates/svc.yaml b/bitnami/gitea/templates/svc.yaml index 6d4081db1c..2d4abc2367 100644 --- a/bitnami/gitea/templates/svc.yaml +++ b/bitnami/gitea/templates/svc.yaml @@ -8,18 +8,10 @@ kind: Service metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.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 or .Values.commonAnnotations .Values.service.annotations }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.service.annotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }} - {{- end }} + {{- $annotations := merge .Values.service.annotations .Values.commonAnnotations }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} {{- end }} spec: type: {{ .Values.service.type }} @@ -63,4 +55,5 @@ 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.podLabels .Values.commonLabels }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} diff --git a/bitnami/gitea/templates/tls-secrets.yaml b/bitnami/gitea/templates/tls-secrets.yaml index 123e67b9b3..c13013de04 100644 --- a/bitnami/gitea/templates/tls-secrets.yaml +++ b/bitnami/gitea/templates/tls-secrets.yaml @@ -11,10 +11,7 @@ kind: Secret metadata: name: {{ .name }} namespace: {{ include "common.names.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 }} @@ -34,10 +31,7 @@ kind: Secret metadata: name: {{ $secretName }} namespace: {{ include "common.names.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 }}