Skip to content

Commit 74fb928

Browse files
author
Arano-kai
committed
feat(helpers): sort schema apply sequence
Custom schema filenames are inserted into LDAP_EXTRA_SCHEMAS in an unsorted fashion, causing inconsistencies every time a new schema is added, or even in a different version of the helm. This commit enable customSchemaFiles keys sorting, allowing control over the loading sequence and using dependent custom schemas.
1 parent 506808b commit 74fb928

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

templates/_helpers.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Cannot return list => return string comma separated
188188
*/}}
189189
{{- define "openldap.customSchemaFiles" -}}
190190
{{- $schemas := "" -}}
191-
{{- $schemas := ((join "," (.Values.customSchemaFiles | keys)) | replace ".ldif" "") -}}
191+
{{- $schemas := ((join "," (.Values.customSchemaFiles | keys | sortAlpha)) | replace ".ldif" "") -}}
192192
{{- print $schemas -}}
193193
{{- end -}}
194194

values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ pdb:
121121
# group: readers
122122

123123
# Custom openldap schema files used to be used in addition to default schemas
124+
# Note that the supplied files are sorted by name and inserted into 'LDAP_EXTRA_SCHEMAS' env var
125+
# after chart default schemas, allowing you to control the loading sequence.
124126
# customSchemaFiles:
125127
# custom.ldif: |-
126128
# # custom schema

0 commit comments

Comments
 (0)