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

Import order of customSchemaFiles not deterministic #104

Closed
wkloucek opened this issue Apr 5, 2023 · 2 comments
Closed

Import order of customSchemaFiles not deterministic #104

wkloucek opened this issue Apr 5, 2023 · 2 comments
Labels
wontfix This will not be worked on

Comments

@wkloucek
Copy link
Contributor

wkloucek commented Apr 5, 2023

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

helm-openldap/values.yaml

Lines 122 to 127 in 6c1d9bf

# Custom openldap schema files used to be used in addition to default schemas
# customSchemaFiles:
# custom.ldif: |-
# # custom schema
# anothercustom.ldif: |-
# # another custom schema

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

{{- if .Values.customSchemaFiles}}
{{- range $file := (include "openldap.customSchemaFiles" . | split ",") }}
- name: custom-schema-files
mountPath: /opt/bitnami/openldap/etc/schema/{{ $file }}.ldif
subPath: {{ $file }}.ldif
{{- end }}
{{- end }}

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

Hey @wkloucek, thanks for reporting it !

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

@stale
Copy link

stale bot commented Jun 10, 2023

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.

@stale stale bot added the wontfix This will not be worked on label Jun 10, 2023
@stale stale bot closed this as completed Jun 17, 2023
wkloucek added a commit to wkloucek/helm-openldap that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants