Skip to content

Commit

Permalink
dedup helpers code
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Feb 20, 2023
1 parent fa06a99 commit 419f828
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,8 @@ Return the list of all schema files to use
Cannot return list => return string comma separated
*/}}
{{- define "openldap.schemaFiles" -}}
{{- /* begin of shared part with "openldap.builtinSchemaFiles" */ -}}
{{- $schemas := "" -}}
{{- if .Values.replication.enabled -}}
{{- $schemas = "syncprov,serverid,csyncprov,rep,bsyncprov,brep,acls" -}}
{{- else -}}
{{- $schemas = "acls" -}}
{{- end -}}
{{- /* end of shared part with "openldap.builtinSchemaFiles" */ -}}
{{- /* begin of shared part with "openldap.customSchemaFiles" */ -}}
{{- $custom_schemas := ((join "," (.Values.customSchemaFiles | keys)) | replace ".ldif" "") -}}
{{- /* end of shared part with "openldap.customSchemaFiles" */ -}}
{{- $schemas := (include "openldap.builtinSchemaFiles" .) -}}
{{- $custom_schemas := (include "openldap.customSchemaFiles" .) -}}
{{- if gt (len $custom_schemas) 0 -}}
{{- $schemas = print $schemas "," $custom_schemas -}}
{{- end -}}
Expand Down

0 comments on commit 419f828

Please sign in to comment.