From 395ed6627f289370db5a1d9e423eeb67a57334a0 Mon Sep 17 00:00:00 2001 From: Valentin Fedoskin Date: Thu, 9 Apr 2020 12:27:08 +0200 Subject: [PATCH] Revert "fix service account creation for backups" This reverts commit 5382e404 --- charts/gitlab-omnibus/Chart.yaml | 2 +- charts/gitlab-omnibus/README.md | 2 +- charts/gitlab-omnibus/templates/_helpers.tpl | 2 +- charts/gitlab-omnibus/templates/rbac-backup.yaml | 8 +++++++- charts/gitlab-omnibus/templates/serviceaccount.yaml | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/charts/gitlab-omnibus/Chart.yaml b/charts/gitlab-omnibus/Chart.yaml index 397396a..f002246 100644 --- a/charts/gitlab-omnibus/Chart.yaml +++ b/charts/gitlab-omnibus/Chart.yaml @@ -3,7 +3,7 @@ name: gitlab-omnibus description: |- Helm chart to deploy [Omnibus Gitlab](https://docs.gitlab.com/omnibus/). type: application -version: 0.0.9 +version: 0.0.8 appVersion: "12.9.2-ee.0" home: https://github.com/slamdev/helm-charts/tree/master/charts/gitlab-omnibus icon: https://docs.gitlab.com/assets/images/gitlab-logo.svg diff --git a/charts/gitlab-omnibus/README.md b/charts/gitlab-omnibus/README.md index 082a1ea..e8b44a1 100644 --- a/charts/gitlab-omnibus/README.md +++ b/charts/gitlab-omnibus/README.md @@ -2,7 +2,7 @@ gitlab-omnibus ============== Helm chart to deploy [Omnibus Gitlab](https://docs.gitlab.com/omnibus/). -Current chart version is `0.0.9` +Current chart version is `0.0.8` Source code can be found [here](https://github.com/slamdev/helm-charts/tree/master/charts/gitlab-omnibus) diff --git a/charts/gitlab-omnibus/templates/_helpers.tpl b/charts/gitlab-omnibus/templates/_helpers.tpl index 80081de..0e14e0a 100644 --- a/charts/gitlab-omnibus/templates/_helpers.tpl +++ b/charts/gitlab-omnibus/templates/_helpers.tpl @@ -55,7 +55,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} Create the name of the service account to use */}} {{- define "gitlab.serviceAccountName" -}} -{{- if or (.Values.serviceAccount.create) (.Values.backupCronJob.enabled) -}} +{{- if .Values.serviceAccount.create -}} {{ default (include "gitlab.fullname" .) .Values.serviceAccount.name }} {{- else -}} {{ default "default" .Values.serviceAccount.name }} diff --git a/charts/gitlab-omnibus/templates/rbac-backup.yaml b/charts/gitlab-omnibus/templates/rbac-backup.yaml index 08beac0..da66cf5 100644 --- a/charts/gitlab-omnibus/templates/rbac-backup.yaml +++ b/charts/gitlab-omnibus/templates/rbac-backup.yaml @@ -1,4 +1,10 @@ {{- if .Values.backupCronJob.enabled -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "gitlab.fullname" . }}-backup + namespace: {{ .Release.Namespace }} +--- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -37,6 +43,6 @@ roleRef: name: {{ include "gitlab.fullname" . }}-backup subjects: - kind: ServiceAccount - name: {{ include "gitlab.fullname" . }} + name: {{ include "gitlab.fullname" . }}-backup {{- end -}} diff --git a/charts/gitlab-omnibus/templates/serviceaccount.yaml b/charts/gitlab-omnibus/templates/serviceaccount.yaml index 7ee0b60..eb203bb 100644 --- a/charts/gitlab-omnibus/templates/serviceaccount.yaml +++ b/charts/gitlab-omnibus/templates/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{- if or (.Values.serviceAccount.create) (.Values.backupCronJob.enabled) -}} +{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: