|
57 | 57 | {{- if (and (and (ne $values.auth.sasl.secretRef "") $values.auth.sasl.enabled) (gt ((get (fromJson (include "_shims.len" (dict "a" (list $values.auth.sasl.users) ))) "r") | int) (0 | int))) -}} |
58 | 58 | {{- $secret := (mustMergeOverwrite (dict "metadata" (dict "creationTimestamp" (coalesce nil) ) ) (mustMergeOverwrite (dict ) (dict "apiVersion" "v1" "kind" "Secret" )) (dict "metadata" (mustMergeOverwrite (dict "creationTimestamp" (coalesce nil) ) (dict "name" $values.auth.sasl.secretRef "namespace" $dot.Release.Namespace "labels" (get (fromJson (include "redpanda.FullLabels" (dict "a" (list $dot) ))) "r") )) "type" "Opaque" "stringData" (dict ) )) -}} |
59 | 59 | {{- $usersTxt := (list ) -}} |
| 60 | +{{- $defaultMechanism := "SCRAM-SHA-512" -}} |
| 61 | +{{- if (ne $values.auth.sasl.mechanism "") -}} |
| 62 | +{{- $defaultMechanism = $values.auth.sasl.mechanism -}} |
| 63 | +{{- end -}} |
60 | 64 | {{- range $_, $user := $values.auth.sasl.users -}} |
61 | | -{{- if (empty $user.mechanism) -}} |
62 | | -{{- $usersTxt = (concat (default (list ) $usersTxt) (list (printf "%s:%s" $user.name $user.password))) -}} |
63 | | -{{- else -}} |
64 | | -{{- $usersTxt = (concat (default (list ) $usersTxt) (list (printf "%s:%s:%s" $user.name $user.password $user.mechanism))) -}} |
| 65 | +{{- $mechanism := $defaultMechanism -}} |
| 66 | +{{- if (not (empty $user.mechanism)) -}} |
| 67 | +{{- $mechanism = $user.mechanism -}} |
65 | 68 | {{- end -}} |
| 69 | +{{- $usersTxt = (concat (default (list ) $usersTxt) (list (printf "%s:%s:%s" $user.name $user.password $mechanism))) -}} |
66 | 70 | {{- end -}} |
67 | 71 | {{- if $_is_returning -}} |
68 | 72 | {{- break -}} |
|
93 | 97 | {{- break -}} |
94 | 98 | {{- end -}} |
95 | 99 | {{- $secretName := (printf "%s-bootstrap-user" (get (fromJson (include "redpanda.Fullname" (dict "a" (list $dot) ))) "r")) -}} |
96 | | -{{- $_203_existing_4_ok_5 := (get (fromJson (include "_shims.lookup" (dict "a" (list "v1" "Secret" $dot.Release.Namespace $secretName) ))) "r") -}} |
97 | | -{{- $existing_4 := (index $_203_existing_4_ok_5 0) -}} |
98 | | -{{- $ok_5 := (index $_203_existing_4_ok_5 1) -}} |
| 100 | +{{- $_209_existing_4_ok_5 := (get (fromJson (include "_shims.lookup" (dict "a" (list "v1" "Secret" $dot.Release.Namespace $secretName) ))) "r") -}} |
| 101 | +{{- $existing_4 := (index $_209_existing_4_ok_5 0) -}} |
| 102 | +{{- $ok_5 := (index $_209_existing_4_ok_5 1) -}} |
99 | 103 | {{- if $ok_5 -}} |
100 | 104 | {{- $_is_returning = true -}} |
101 | 105 | {{- (dict "r" $existing_4) | toJson -}} |
|
0 commit comments