Skip to content

Commit

Permalink
fix custom command, rely on values so that custom containers can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfrickert committed Nov 6, 2024
1 parent b67d654 commit bc93130
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
16 changes: 0 additions & 16 deletions templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,6 @@ spec:
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
command:
- sh
- -c
- |
host=$(hostname)
if [ "$host" = "{{ template "openldap.fullname" . }}-0" ]
then
echo "This is the first openldap pod so let's init all additional schemas and ldifs here"
else
echo "This is not the first openldap pod so let's not init anything"
unset LDAP_CONFIGURE_PPOLICY LDAP_PPOLICY_HASH_CLEARTEXT
export LDAP_SKIP_DEFAULT_TREE=yes
fi
/opt/bitnami/scripts/openldap/entrypoint.sh /opt/bitnami/scripts/openldap/run.sh
env:
- name: LDAP_EXTRA_SCHEMAS
value: {{ print "cosine,inetorgperson,nis," (include "openldap.schemaFiles" (dict "context" . )) }}
Expand Down
16 changes: 15 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,21 @@ containerSecurityContext:
existingConfigmap:
## @param command Override default container command (useful when using custom images)
##
command: []
command:
- sh
- -c
- |
host=$(hostname)
if [ "$host" = "{{ template "openldap.fullname" . }}-0" ]
then
echo "This is the first openldap pod so let's init all additional schemas and ldifs here"
else
echo "This is not the first openldap pod so let's not init anything"
unset LDAP_CONFIGURE_PPOLICY LDAP_PPOLICY_HASH_CLEARTEXT
export LDAP_SKIP_DEFAULT_TREE=yes
fi
exec /opt/bitnami/scripts/openldap/entrypoint.sh
## @param args Override default container args (useful when using custom images)
##
args: []
Expand Down

0 comments on commit bc93130

Please sign in to comment.