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 committed Sep 18, 2024
1 parent 92ff42d commit c0bb622
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions charts/netbox/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Get the application URL by running these commands:
export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . | quote }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ include "common.names.namespace" . | quote }} svc -w {{ include "common.names.fullname" . }}'
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ include "common.names.namespace" . | quote }} svc -w {{ include "common.names.fullname" . }}'

{{- else if contains "ClusterIP" .Values.service.type }}

Expand All @@ -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 c0bb622

Please sign in to comment.