Skip to content

Commit

Permalink
fix service account creation for backups
Browse files Browse the repository at this point in the history
  • Loading branch information
slamdev committed Apr 9, 2020
1 parent a287299 commit 5382e40
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/gitlab-omnibus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: gitlab-omnibus
description: |-
Helm chart to deploy [Omnibus Gitlab](https://docs.gitlab.com/omnibus/).
type: application
version: 0.0.8
version: 0.0.9
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
Expand Down
2 changes: 1 addition & 1 deletion charts/gitlab-omnibus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ gitlab-omnibus
==============
Helm chart to deploy [Omnibus Gitlab](https://docs.gitlab.com/omnibus/).

Current chart version is `0.0.8`
Current chart version is `0.0.9`

Source code can be found [here](https://github.com/slamdev/helm-charts/tree/master/charts/gitlab-omnibus)

Expand Down
2 changes: 1 addition & 1 deletion charts/gitlab-omnibus/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
Create the name of the service account to use
*/}}
{{- define "gitlab.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{- if or (.Values.serviceAccount.create) (.Values.backupCronJob.enabled) -}}
{{ default (include "gitlab.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
Expand Down
8 changes: 1 addition & 7 deletions charts/gitlab-omnibus/templates/rbac-backup.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{{- 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:
Expand Down Expand Up @@ -43,6 +37,6 @@ roleRef:
name: {{ include "gitlab.fullname" . }}-backup
subjects:
- kind: ServiceAccount
name: {{ include "gitlab.fullname" . }}-backup
name: {{ include "gitlab.fullname" . }}

{{- end -}}
2 changes: 1 addition & 1 deletion charts/gitlab-omnibus/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.serviceAccount.create -}}
{{- if or (.Values.serviceAccount.create) (.Values.backupCronJob.enabled) -}}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down

0 comments on commit 5382e40

Please sign in to comment.