From 2a96c662d31222b9554115b3235b958f4f804028 Mon Sep 17 00:00:00 2001 From: Guillaume Delbergue Date: Sat, 18 Mar 2023 19:55:58 +0100 Subject: [PATCH] disable registry secrets mount if registry is disabled Signed-off-by: Guillaume Delbergue --- charts/gitlab/charts/sidekiq/templates/deployment.yaml | 2 ++ charts/gitlab/charts/toolbox/templates/backup-job.yaml | 2 ++ charts/gitlab/charts/toolbox/templates/deployment.yaml | 2 ++ charts/gitlab/charts/webservice/templates/deployment.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/charts/gitlab/charts/sidekiq/templates/deployment.yaml b/charts/gitlab/charts/sidekiq/templates/deployment.yaml index 7e02be4aa2..55aa56d84d 100644 --- a/charts/gitlab/charts/sidekiq/templates/deployment.yaml +++ b/charts/gitlab/charts/sidekiq/templates/deployment.yaml @@ -329,12 +329,14 @@ spec: - key: {{ template "gitlab.geo.psql.password.key" $ }} path: postgres/geo-psql-password {{- end }} + {{- if $.Values.registry.enabled }} - secret: name: {{ template "gitlab.registry.certificate.secret" $ }} items: - key: registry-auth.key path: registry/gitlab-registry.key {{- include "gitlab.registry.notificationSecret.mount" $ | nindent 10 -}} + {{- end }} {{- include "gitlab.pages.mountSecrets" $ | nindent 10 }} {{- include "gitlab.kas.mountSecrets" $ | nindent 10 }} {{- include "gitlab.suggestedReviewers.mountSecrets" $ | nindent 10 }} diff --git a/charts/gitlab/charts/toolbox/templates/backup-job.yaml b/charts/gitlab/charts/toolbox/templates/backup-job.yaml index 6c22362007..9df8d6e84f 100644 --- a/charts/gitlab/charts/toolbox/templates/backup-job.yaml +++ b/charts/gitlab/charts/toolbox/templates/backup-job.yaml @@ -194,12 +194,14 @@ spec: {{- range $.Values.local.psql }} {{- include "gitlab.psql.secret" . | nindent 16 }} {{- end }} + {{- if $.Values.global.registry.enabled }} - secret: name: {{ template "gitlab.registry.certificate.secret" . }} items: - key: registry-auth.key path: registry/gitlab-registry.key {{- include "gitlab.registry.notificationSecret.mount" $ | nindent 16 -}} + {{- end }} {{- if or .Values.backups.objectStorage.config (not .Values.global.minio.enabled) }} {{- include "toolbox.backups.objectStorage.config.secret" .Values.backups.objectStorage | nindent 16 }} {{- end }} diff --git a/charts/gitlab/charts/toolbox/templates/deployment.yaml b/charts/gitlab/charts/toolbox/templates/deployment.yaml index b692cf2371..6a39d52eac 100644 --- a/charts/gitlab/charts/toolbox/templates/deployment.yaml +++ b/charts/gitlab/charts/toolbox/templates/deployment.yaml @@ -226,12 +226,14 @@ spec: - key: {{ template "gitlab.geo.psql.password.key" . }} path: postgres/geo-psql-password {{- end }} + {{- if $.Values.global.registry.enabled }} - secret: name: {{ template "gitlab.registry.certificate.secret" . }} items: - key: registry-auth.key path: registry/gitlab-registry.key {{- include "gitlab.registry.notificationSecret.mount" $ | nindent 10 -}} + {{- end }} {{- if or .Values.backups.objectStorage.config (not (or .Values.global.minio.enabled .Values.global.appConfig.object_store.enabled)) }} {{- include "toolbox.backups.objectStorage.config.secret" .Values.backups.objectStorage | nindent 10 }} {{- end }} diff --git a/charts/gitlab/charts/webservice/templates/deployment.yaml b/charts/gitlab/charts/webservice/templates/deployment.yaml index 95111a72a9..9fad0c4d5d 100644 --- a/charts/gitlab/charts/webservice/templates/deployment.yaml +++ b/charts/gitlab/charts/webservice/templates/deployment.yaml @@ -491,12 +491,14 @@ spec: - key: {{ template "gitlab.geo.psql.password.key" $ }} path: postgres/geo-psql-password {{- end }} + {{- if $.Values.registry.enabled }} - secret: name: {{ template "gitlab.registry.certificate.secret" $ }} items: - key: registry-auth.key path: registry/gitlab-registry.key {{- include "gitlab.registry.notificationSecret.mount" $ | nindent 10 }} + {{- end }} - secret: name: {{ template "gitlab.workhorse.secret" $ }} items: -- GitLab