Skip to content

Commit

Permalink
Use common helper to manage password and report accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb authored Sep 9, 2024
1 parent ed729ae commit 1bde8b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions charts/netbox/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,3 @@ Get the application URL by running these commands:
{{- include "common.warnings.rollingTag" .Values.image }}
{{- include "common.warnings.rollingTag" .Values.init.image }}
{{- include "common.warnings.resources" (dict "sections" (list "" "worker") "context" $) }}
{{- $passwordValidationErrors := list -}}
{{- if not .Values.superuser.existingSecret -}}
{{- $superuserPasswordValidationErrors := include "common.validations.values.single.empty" (dict "valueKey" "superuser.password" "secret" (include "common.secrets.name" (dict "defaultNameSuffix" "superuser" "context" .)) "field" "password" "context" $) -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $superuserPasswordValidationErrors -}}
{{- end }}
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $) -}}
2 changes: 1 addition & 1 deletion charts/netbox/templates/superuser-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
type: kubernetes.io/basic-auth
data:
username: {{ .Values.superuser.name | default "admin" | b64enc | quote }}
password: {{ .Values.superuser.password | default (randAlphaNum 16) | b64enc | quote }}
password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "common.secrets.name" (dict "defaultNameSuffix" "superuser" "context" $)) "key" "password" "providedValues" (list "superuser.password") "context" $) }}
email: {{ .Values.superuser.email | b64enc | quote }}
api_token: {{ .Values.superuser.apiToken | default uuidv4 | b64enc | quote }}
{{- end -}}

0 comments on commit 1bde8b3

Please sign in to comment.