File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ type: application
1616# This is the chart version. This version number should be incremented each time you make changes
1717# to the chart and its templates, including the app version.
1818# Versions are expected to follow Semantic Versioning (https://semver.org/)
19- version : 0.3 .0
19+ version : 0.4 .0
2020
2121# This is the version number of the application being deployed. This version number should be
2222# incremented each time you make changes to the application. Versions are not expected to
Original file line number Diff line number Diff line change 1+ apiVersion : rbac.authorization.k8s.io/v1
2+ kind : Role
3+ metadata :
4+ name : {{ .Release.Name }}-dashboard-resources
5+ rules :
6+ - apiGroups :
7+ - " "
8+ resources :
9+ - services
10+ resourceNames :
11+ - {{ .Release.Name }}
12+ verbs : ["get", "list", "watch"]
13+ - apiGroups :
14+ - " "
15+ resources :
16+ - secrets
17+ resourceNames :
18+ - {{ .Release.Name }}-credentials
19+ verbs : ["get", "list", "watch"]
Original file line number Diff line number Diff line change 1+ {{- $existingSecret := lookup "v1" "Secret" .Release.Namespace (printf "%s-credentials" .Release.Name) }}
2+ {{- $passwords := dict }}
3+
4+ {{- with (index $existingSecret "data") }}
5+ {{- range $k, $v := . }}
6+ {{- $_ := set $passwords $k (b64dec $v) }}
7+ {{- end }}
8+ {{- end }}
9+
10+ {{- range $user, $u := .Values.users }}
11+ {{- if $u.password }}
12+ {{- $_ := set $passwords $user $u.password }}
13+ {{- else if not (index $passwords $user) }}
14+ {{- $_ := set $passwords $user (randAlphaNum 16) }}
15+ {{- end }}
16+ {{- end }}
17+
18+ {{- if .Values.users }}
19+ apiVersion : v1
20+ kind : Secret
21+ metadata :
22+ name : {{ .Release.Name }}-credentials
23+ stringData :
24+ {{- range $user, $u := .Values.users }}
25+ {{ quote $user }}: {{ quote (index $passwords $user) }}
26+ {{- end }}
27+ {{- end }}
128---
229apiVersion : v1
330kind : Secret
@@ -13,7 +40,7 @@ stringData:
1340 {{- range $user, $u := .Values.users }}
1441 SELECT 'CREATE ROLE {{ $user }} LOGIN INHERIT;'
1542 WHERE NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = '{{ $user }}')\gexec
16- ALTER ROLE {{ $user }} WITH PASSWORD '{{ $u.password }}' LOGIN INHERIT {{ ternary "REPLICATION" "NOREPLICATION" (default false $u.replication) }};
43+ ALTER ROLE {{ $user }} WITH PASSWORD '{{ index $passwords $user }}' LOGIN INHERIT {{ ternary "REPLICATION" "NOREPLICATION" (default false $u.replication) }};
1744 COMMENT ON ROLE {{ $user }} IS 'user managed by helm';
1845 {{- end }}
1946 EOT
You can’t perform that action at this time.
0 commit comments