Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command to openldap container #194

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
16 changes: 16 additions & 0 deletions templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,22 @@ spec:
{{- if .Values.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one conflicts with recently restored command on L177.
To not overwrite user supplied .Values.command please move above L176 or incorporate condition block.

- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bitnami-specific and fail on custom container.
Either we postulate that only bitnami/openldap is supported, or check that things in place before calls.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the /opt/bitnami/scripts/openldap/run.sh is actually default CMD (args in k8s manifest), so highly recommend change:

  • fom /opt/bitnami/scripts/openldap/entrypoint.sh /opt/bitnami/scripts/openldap/run.sh
  • to exec /opt/bitnami/scripts/openldap/entrypoint.sh

That will avoid overwriting default or user-supplied args.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, just came back from vacation will try to resolve these issues this or next week

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the /opt/bitnami/scripts/openldap/run.sh is actually default CMD (args in k8s manifest), so highly recommend change:

* fom `/opt/bitnami/scripts/openldap/entrypoint.sh /opt/bitnami/scripts/openldap/run.sh`

* to `exec /opt/bitnami/scripts/openldap/entrypoint.sh`

That will avoid overwriting default or user-supplied args.

hmm exec /opt/bitnami/scripts/openldap/entrypoint.sh does not seem to work
--> /opt/bitnami/scripts/openldap/entrypoint.sh: line 14: $1: unbound variable

(from latest commit on this PR)


env:
- name: POD_NAME
valueFrom:
Expand Down