|
1 |
| -{{- $password := (randAlphaNum 32) | b64enc }} |
2 |
| -{{- $username := (randAlphaNum 32) | b64enc }} |
| 1 | +{{- $bPassword := (randAlphaNum 32) | b64enc }} |
| 2 | +{{- $bUsername := (randAlphaNum 32) | b64enc }} |
| 3 | +{{- $pPassword := (randAlphaNum 32) | b64enc }} |
| 4 | +{{- $pUsername := (randAlphaNum 32) | b64enc }} |
3 | 5 |
|
4 |
| -{{- $secretName := printf "%s-%s" (include "coms.fullname" .) "basicauth" }} |
5 |
| -{{- $secret := (lookup "v1" "Secret" .Release.Namespace $secretName ) }} |
6 |
| -{{- if not $secret }} |
| 6 | +{{- $bSecretName := printf "%s-%s" (include "coms.fullname" .) "basicauth" }} |
| 7 | +{{- $bSecret := (lookup "v1" "Secret" .Release.Namespace $bSecretName ) }} |
| 8 | +{{- $pSecretName := printf "%s-%s" (include "coms.fullname" .) "passphrase" }} |
| 9 | +{{- $pSecret := (lookup "v1" "Secret" .Release.Namespace $pSecretName ) }} |
| 10 | + |
| 11 | +{{- if not $bSecret }} |
| 12 | +--- |
| 13 | +apiVersion: v1 |
| 14 | +kind: Secret |
| 15 | +metadata: |
| 16 | + annotations: |
| 17 | + "helm.sh/resource-policy": keep |
| 18 | + name: {{ $bSecretName }} |
| 19 | + labels: {{ include "coms.labels" . | nindent 4 }} |
| 20 | +type: kubernetes.io/basic-auth |
| 21 | +data: |
| 22 | + password: {{ $bPassword }} |
| 23 | + username: {{ $bUsername }} |
| 24 | +{{- end }} |
| 25 | +{{- if not $pSecret }} |
7 | 26 | ---
|
8 | 27 | apiVersion: v1
|
9 | 28 | kind: Secret
|
10 | 29 | metadata:
|
11 | 30 | annotations:
|
12 | 31 | "helm.sh/resource-policy": keep
|
13 |
| - name: {{ $secretName }} |
| 32 | + name: {{ $pSecretName }} |
14 | 33 | labels: {{ include "coms.labels" . | nindent 4 }}
|
15 | 34 | type: kubernetes.io/basic-auth
|
16 | 35 | data:
|
17 |
| - password: {{ $password }} |
18 |
| - username: {{ $username }} |
| 36 | + password: {{ $pPassword }} |
| 37 | + username: {{ $pUsername }} |
19 | 38 | {{- end }}
|
0 commit comments