jp-gouin/helm-openldap

Use replace strategy in replication configurations.

pritchardtw opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
When updating replication configuration it will not replace existing rules, but append to them. So when swapping starttls from "critical" to "no", it adds 3 additions syncrepls, instead of replacing the 3 that were created at bootstrap time.

kubectl exec -it ldap-2 -- /bin/bash -c "ldapmodify -H ldap://localhost:1389 -D <admin> -w <password> -f custom-config/03_brep-modify.ldif"

Describe the solution you'd like
We can swap
https://github.com/jp-gouin/helm-openldap/blob/master/templates/configmap-replication-acls.yaml#L43
https://github.com/jp-gouin/helm-openldap/blob/master/templates/configmap-replication-acls.yaml#L46
https://github.com/jp-gouin/helm-openldap/blob/master/templates/configmap-replication-acls.yaml#L57
https://github.com/jp-gouin/helm-openldap/blob/master/templates/configmap-replication-acls.yaml#L62

From add -> replace which is essentially an upsert.

This also makes the ldapmodify idempotent.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I've manully edited my chart to do this.

Additional context
Add any other context or screenshots about the feature request here.

Hi @pritchardtw , would you like to submit a PR ?