Skip to content

Commit b0fb692

Browse files
vakwetuclaude
authored andcommitted
[multiple] Use strategic merge patch in Keystone federation kustomization
Replace the JSON Patch (op/path/value) entries in the kustomize file written by hook_controlplane_config.yml with a single strategic merge patch. The JSON Patch approach was fragile: `add /spec/tls/caBundleSecretName` would fail if spec.tls had no parent yet, and adding the parent first as an empty dict would clobber existing TLS fields. A strategic merge patch merges at each level, so it works regardless of whether spec.tls already exists and leaves any pre-existing TLS fields untouched. Signed-off-by: Ade Lee <alee@redhat.com> Co-Authored-By: Claude <noreply@anthropic.com> Made-with: Cursor
1 parent 5fdbfd7 commit b0fb692

1 file changed

Lines changed: 21 additions & 19 deletions

File tree

roles/federation/tasks/hook_controlplane_config.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,27 @@
141141
kind: OpenStackControlPlane
142142
name: .*
143143
patch: |-
144-
- op: add
145-
path: /spec/tls/caBundleSecretName
146-
value: {{ _federation_ca_bundle_secret_name }}
147-
- op: add
148-
path: /spec/keystone/template/httpdCustomization
149-
value:
150-
customConfigSecret: keystone-httpd-override
151-
- op: add
152-
path: /spec/keystone/template/customServiceConfig
153-
value: |
154-
[DEFAULT]
155-
insecure_debug=true
156-
debug=true
157-
[federation]
158-
trusted_dashboard={{ cifmw_federation_horizon_url }}/dashboard/auth/websso/
159-
[openid]
160-
remote_id_attribute=HTTP_OIDC_ISS
161-
[auth]
162-
methods = password,token,oauth1,mapped,application_credential,openid
144+
apiVersion: core.openstack.org/v1beta1
145+
kind: OpenStackControlPlane
146+
metadata:
147+
name: controlplane
148+
spec:
149+
tls:
150+
caBundleSecretName: {{ _federation_ca_bundle_secret_name }}
151+
keystone:
152+
template:
153+
httpdCustomization:
154+
customConfigSecret: keystone-httpd-override
155+
customServiceConfig: |
156+
[DEFAULT]
157+
insecure_debug=true
158+
debug=true
159+
[federation]
160+
trusted_dashboard={{ cifmw_federation_horizon_url }}/dashboard/auth/websso/
161+
[openid]
162+
remote_id_attribute=HTTP_OIDC_ISS
163+
[auth]
164+
methods = password,token,oauth1,mapped,application_credential,openid
163165
164166
# ---------------------------------------------------------------------------
165167
# Step 7 - Keystone httpd override secret (always needed)

0 commit comments

Comments
 (0)