jp-gouin / helm-openldap

Helm chart of Openldap in High availability with multi-master replication and PhpLdapAdmin and Ltb-Passwd
Apache License 2.0
183 stars 115 forks source link

Import order of customSchemaFiles not deterministic #104

Closed wkloucek closed 1 year ago

wkloucek commented 1 year ago

Describe the bug If one imports multiple schema files with the customSchemaFiles option, the schema files are imported in a non-deterministic order.

https://github.com/jp-gouin/helm-openldap/blob/6c1d9bf38aa27033e1d1ea54321bb1b6dd4dacb2/values.yaml#L122-L127

This is because the schema files end up in /opt/bitnami/openldap/etc/schema/

https://github.com/jp-gouin/helm-openldap/blob/6c1d9bf38aa27033e1d1ea54321bb1b6dd4dacb2/templates/statefulset.yaml#L212-L218

These files will be loaded by the non deterministic function ldap_add_schemas function: https://github.com/bitnami/containers/blob/main/bitnami/openldap/2.6/debian-11/rootfs/opt/bitnami/scripts/libopenldap.sh#L416-L422

Instead we should load these custom schema files by the deterministic ldap_add_custom_schemas function: https://github.com/bitnami/containers/blob/main/bitnami/openldap/2.6/debian-11/rootfs/opt/bitnami/scripts/libopenldap.sh#L450-L455

Expected behavior custom ldap schemas passed into customSchemaFiles are loaded in a deterministic order, sorted by filename.

Additional context

I probably won't work on this for the next weeks. A possible workaround is to have only one schema file (with multiple schemas in it).

jp-gouin commented 1 year ago

Hey @wkloucek, thanks for reporting it !

Feel free to submit a PR when you got time to work on it :)

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.