jp-gouin / helm-openldap

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

Use replace strategy in replication configurations. #190

Open pritchardtw opened 1 month ago

pritchardtw commented 1 month ago

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.

jp-gouin commented 1 month ago

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