Skip to content

Commit

Permalink
avoid adding empty username/password when not set
Browse files Browse the repository at this point in the history
  • Loading branch information
enneitex committed Dec 24, 2024
1 parent 43016b0 commit 8f5239b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions charts/policy-reporter/templates/cluster-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ data:
{{- $username := .Values.basicAuth.username }}
{{- $password := .Values.basicAuth.password }}
host: {{ printf "http://%s:%d" (include "policyreporter.fullname" .) (.Values.service.port | int) | b64enc }}
username: {{ $username | b64enc }}
password: {{ $password | b64enc }}
{{- if .Values.basicAuth.username }}
username: {{ .Values.basicAuth.username | b64enc }}
{{- end }}
{{- if .Values.basicAuth.password }}
password: {{ .Values.basicAuth.password | b64enc }}
{{- end }}
{{- if .Values.plugin.kyverno.enabled }}
{{- $host := printf "http://%s:%d" (include "kyverno-plugin.fullname" .) (.Values.plugin.kyverno.service.port | int) }}
plugin.kyverno: {{ (printf "{\"host\":\"%s\", \"name\":\"kyverno\", \"username\":\"%s\", \"password\":\"%s\"}" $host $username $password) | b64enc }}
Expand Down

0 comments on commit 8f5239b

Please sign in to comment.