Skip to content

fix: scope LDAP domain terraform applies to LDAP resources#881

Merged
MylesJP merged 1 commit into
canonical:stable/2025.1from
MylesJP:backport/2025.1-lp2159042
Jul 10, 2026
Merged

fix: scope LDAP domain terraform applies to LDAP resources#881
MylesJP merged 1 commit into
canonical:stable/2025.1from
MylesJP:backport/2025.1-lp2159042

Conversation

@MylesJP

@MylesJP MylesJP commented Jul 9, 2026

Copy link
Copy Markdown

Clean cherry-pick of bf67f54 (#877) to stable/2025.1.

The LDAP add/update/remove-domain steps re-apply the entire OpenStack
Terraform plan. Since Terraform owns the charm config of every application in
the plan, any config set out-of-band with juju config (e.g. Traefik TLS
certificates) was reverted as drift whenever an LDAP domain was managed.

Pass -target flags for the three LDAP domain resources
(juju_application.ldap-apps, juju_integration.ldap-apps-to-logging,
juju_integration.ldap-to-keystone) so these steps only reconcile what they
own — the same pattern already used in steps/mysql.py, steps/hypervisor.py
and steps/vault.py. Targeted applies still destroy orphaned for_each
instances, so remove-domain continues to remove the keystone-ldap-
application.

Closes-bug: #2159042

QA steps

On a deployment with the LDAP feature enabled:

  1. Set TLS config on traefik-public out-of-band (a self-signed cert is fine):
    openssl req -x509 -newkey rsa:2048 -nodes -days 30 \
      -keyout key.pem -out cert.pem -subj "/CN=cloud.test"
    juju config -m openstack traefik-public \
      tls-cert="$(cat cert.pem)" tls-key="$(cat key.pem)"
  1. Run each LDAP domain operation (the LDAP server does not need to exist;

    keystone-ldap-k8s is a config-only charm):

    sunbeam ldap add-domain testdom --domain-config-file domain.yaml
    sunbeam ldap update-domain testdom --domain-config-file domain.yaml
    sunbeam ldap remove-domain testdom
  1. After each operation, verify the TLS config survived (without this fix,
    add-domain clears it):

juju config -m openstack traefik-public tls-cert

  1. Verify remove-domain still deletes the domain application:

juju status -m openstack | grep keystone-ldap # expect no output

Verified end-to-end on a single-node 2024.1 deployment (repro on stock rev
1060, fix confirmed with a patched snap); transcript and logs attached to the
LP bug.

Links

Bug: https://bugs.launchpad.net/snap-openstack/+bug/2159042
Jira card: OPEN-4637

The LDAP add/update/remove-domain steps re-apply the entire OpenStack
Terraform plan. Since Terraform owns the charm config of every
application in the plan, any config set out-of-band with juju config
(e.g. Traefik TLS certificates) was reverted as drift whenever an LDAP
domain was managed.

Pass -target flags for the three LDAP domain resources so these steps
only reconcile what they own. Targeted applies still destroy orphaned
for_each instances, so remove-domain continues to remove the
keystone-ldap-<domain> application.

Closes-Bug: #2159042
Signed-off-by: Myles Penner <myles.penner@canonical.com>
(cherry picked from commit bf67f54)
@MylesJP
MylesJP merged commit aa0ae93 into canonical:stable/2025.1 Jul 10, 2026
8 of 9 checks passed
@MylesJP
MylesJP deleted the backport/2025.1-lp2159042 branch July 10, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants