diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 4c74291..d7b5959 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -392,3 +392,11 @@ https {{- define "gitea.serviceAccountName" -}} {{ .Values.serviceAccount.name | default (include "gitea.fullname" .) }} {{- end -}} + +{{- define "gitea.admin.passwordMode" -}} +{{- if has .Values.gitea.admin.passwordMode (tuple "keepUpdated" "initialOnlyNoReset" "initialOnlyRequireReset") -}} +{{ .Values.gitea.admin.passwordMode }} +{{- else -}} +{{ printf "gitea.admin.passwordMode must be set to one of 'keepUpdated', 'initialOnlyNoReset', or 'initialOnlyRequireReset'. Received: '%s'" .Values.gitea.admin.passwordMode | fail }} +{{- end -}} +{{- end -}} diff --git a/templates/gitea/deployment.yaml b/templates/gitea/deployment.yaml index 5618f2b..f321f22 100644 --- a/templates/gitea/deployment.yaml +++ b/templates/gitea/deployment.yaml @@ -244,7 +244,7 @@ spec: value: {{ .Values.gitea.admin.password | quote }} {{- end }} - name: GITEA_ADMIN_PASSWORD_MODE - value: {{ .Values.gitea.admin.passwordMode }} + value: {{ include "gitea.admin.passwordMode" $ }} {{- if .Values.deployment.env }} {{- toYaml .Values.deployment.env | nindent 12 }} {{- end }} diff --git a/values.schema.json b/values.schema.json deleted file mode 100644 index 90ac9d7..0000000 --- a/values.schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "properties": { - "gitea": { - "type": "object", - "properties": { - "admin": { - "type": "object", - "required": [ - "passwordMode" - ], - "properties": { - "passwordMode": { - "type": "string", - "enum": [ - "initialOnlyNoReset", - "initialOnlyRequireReset", - "keepUpdated" - ] - } - } - } - } - } - } -} \ No newline at end of file