aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-09-07 07:53:28 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-07 07:53:28 +0000
commit27444aa8fabaecf121d1c6269e4b08fcffce6bcf (patch)
treeb344c8cc3de3d60b07a15d79f4026e69754cf314 /kubernetes/common
parent92878fe491ab5166573fefbf8a3a2e5010813f08 (diff)
parentf5ee1c5aa533c47f93b091eafb366c4185b4ab49 (diff)
Merge "[COMMON] Allow to set default password complexity"
Diffstat (limited to 'kubernetes/common')
-rw-r--r--kubernetes/common/common/templates/_createPassword.tpl15
1 files changed, 14 insertions, 1 deletions
diff --git a/kubernetes/common/common/templates/_createPassword.tpl b/kubernetes/common/common/templates/_createPassword.tpl
index 8b2f1e274d..bfa96daf64 100644
--- a/kubernetes/common/common/templates/_createPassword.tpl
+++ b/kubernetes/common/common/templates/_createPassword.tpl
@@ -37,6 +37,18 @@
{{ end }}
{{- end -}}
+{{- define "common._defaultPasswordStrength" -}}
+ {{ if .Values.passwordStrengthOverride }}
+ {{- printf "%s" .Values.passwordStrengthOverride -}}
+ {{ else if .Values.global.passwordStrength }}
+ {{- printf "%s" .Values.global.passwordStrength -}}
+ {{ else if .Values.passwordStrength }}
+ {{- printf "%s" .Values.passwordStrength -}}
+ {{ else }}
+ {{- printf "long" }}
+ {{ end }}
+{{- end -}}
+
{{/*
Generate a new password based on masterPassword. The new password is not
random, it is derived from masterPassword, fully qualified chart name and
@@ -59,7 +71,8 @@
{{- define "common.createPassword" -}}
{{- $dot := default . .dot -}}
{{- $uid := default "onap" .uid -}}
- {{- $strength := default "long" .strength -}}
+ {{- $defaultStrength := include "common._defaultPasswordStrength" $dot | trim -}}
+ {{- $strength := default $defaultStrength .strength -}}
{{- $mp := include "common.masterPassword" $dot -}}
{{- derivePassword 1 $strength $mp (include "common.fullname" $dot) $uid -}}
{{- end -}}