Skip to content

Commit e98a432

Browse files
duboisphtodpunk
andauthored
fix: service account and allow setting annotations (#29)
* Fix service account * Update charts/verdaccio/values.yaml Co-authored-by: Tod Hansmann <[email protected]> Co-authored-by: Tod Hansmann <[email protected]>
1 parent ce394df commit e98a432

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

charts/verdaccio/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
description: A lightweight private npm proxy registry (sinopia fork)
33
name: verdaccio
4-
version: 0.15.0
4+
version: 0.15.1
55
appVersion: 4.6.2
66
home: https://verdaccio.org
77
icon: https://cdn.verdaccio.dev/logos/default.png

charts/verdaccio/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
1414
{{- $name := default .Chart.Name .Values.nameOverride -}}
1515
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
1616
{{- end -}}
17+
18+
{{/*
19+
Create the name of the service account to use
20+
*/}}
21+
{{- define "verdaccio.serviceAccountName" -}}
22+
{{- if .Values.serviceAccount.enabled }}
23+
{{- default (include "verdaccio.fullname" .) .Values.serviceAccount.name }}
24+
{{- else }}
25+
{{- default "default" .Values.serviceAccount.name }}
26+
{{- end }}
27+
{{- end }}

charts/verdaccio/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ metadata:
88
release: {{ .Release.Name }}
99
name: {{ template "verdaccio.fullname" . }}
1010
spec:
11-
{{- if .Values.serviceAccount.enabled }}
12-
serviceAccountName: {{ template ".Values.serviceAccount.name" . }}
13-
{{- end}}
1411
replicas: {{ .Values.replicaCount }}
1512
selector:
1613
matchLabels:
@@ -34,6 +31,9 @@ spec:
3431
app: {{ template "verdaccio.name" . }}
3532
release: {{ .Release.Name }}
3633
spec:
34+
{{- if .Values.serviceAccount.enabled }}
35+
serviceAccountName: {{ include "verdaccio.serviceAccountName" . }}
36+
{{- end}}
3737
containers:
3838
- name: {{ template "verdaccio.name" . }}
3939
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
{{- if .Values.serviceAccount.enabled }}
1+
{{- if .Values.serviceAccount.enabled -}}
22
---
33
apiVersion: v1
44
kind: ServiceAccount
55
metadata:
6-
name: {{ template ".Values.serviceAccount.name" . }}
6+
name: {{ include "verdaccio.serviceAccountName" . }}
77
labels:
88
app: {{ template "verdaccio.name" . }}
99
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
1010
release: {{ .Release.Name }}
1111
heritage: {{ .Release.Service }}
12+
{{- with .Values.serviceAccount.annotations }}
13+
annotations:
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
1216
{{- end }}

charts/verdaccio/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ ingress:
5454

5555
## Service account
5656
serviceAccount:
57+
# Specifies whether a service account should be created
5758
enabled: false
58-
# name:
59+
# Annotations to add to the service account
60+
annotations: {}
61+
# The name of the service account to use.
62+
# If not set and enabled is true, a name is generated using the Chart's fullname template
63+
name: ""
5964

6065
# Extra Environment Values - allows yaml definitions
6166
extraEnvVars:

0 commit comments

Comments
 (0)