From fd301f8365a439b94ad217de6293e6ec3a52618a Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Mon, 9 Nov 2026 17:48:42 +0100 Subject: [PATCH 1/2] ci: Enable OpenStack Assistant e2e test lightspeed-tests [1] adds an e2e test that talks to goose inside the openstack-assistant Pod over the Agent Client Protocol (ACP): it opens a pod-exec WebSocket from the test Pod, runs `goose acp` and exchanges JSON-RPC messages with it. Running that test in the lightspeed-operator-deployment-crc job requires three adjustments: - Authorize the test Pod to exec into the openstack-assistant Pod: the install playbook now creates a lightspeed-tests-assistant-exec ClusterRole (get/list pods, create/get pods/exec) and binds it to the test-operator ServiceAccount in the test namespace. Both are gated behind openstack_assistant_enabled, which the job already sets. - Project the kube-root-ca.crt ConfigMap into the test Pod's service account token volume. The in-cluster client used by the test reads the token from that volume and also expects ca.crt next to it to verify the API server certificate before opening the exec WebSocket. [1] https://github.com/openstack-k8s-operators/lightspeed-tests/pull/27 Assisted-By: OpenCode:GLM-5.3 --- ci/playbooks/install-openstack-lightspeed.yml | 36 +++++++++++++++++++ zuul.d/jobs.yaml | 5 +++ 2 files changed, 41 insertions(+) diff --git a/ci/playbooks/install-openstack-lightspeed.yml b/ci/playbooks/install-openstack-lightspeed.yml index 0274811..9d9d167 100644 --- a/ci/playbooks/install-openstack-lightspeed.yml +++ b/ci/playbooks/install-openstack-lightspeed.yml @@ -494,6 +494,42 @@ name: "{{ openstack_lightspeed_ansibletest_service_account }}" namespace: "{{ cifmw_test_operator_namespace | default('openstack') }}" + - name: Authorize the test Pod to exec into the openstack-assistant Pod + when: openstack_assistant_enabled | default(false) | bool + kubernetes.core.k8s: + state: present + definition: + apiVersion: rbac.authorization.k8s.io/v1 + kind: ClusterRole + metadata: + name: lightspeed-tests-assistant-exec + rules: + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list"] + - apiGroups: [""] + resources: ["pods/exec"] + verbs: ["create", "get"] + + - name: Bind the exec permissions to the test-operator ServiceAccount + when: openstack_assistant_enabled | default(false) | bool + kubernetes.core.k8s: + state: present + definition: + apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: lightspeed-tests-assistant-exec + namespace: "{{ cifmw_test_operator_namespace | default('openstack') }}" + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: lightspeed-tests-assistant-exec + subjects: + - kind: ServiceAccount + name: "{{ openstack_lightspeed_ansibletest_service_account }}" + namespace: "{{ cifmw_test_operator_namespace | default('openstack') }}" + - name: Create test-operator dummy config ConfigMap kubernetes.core.k8s: state: present diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 83b7e72..22c479d 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -106,6 +106,11 @@ - serviceAccountToken: path: token expirationSeconds: 3600 + - configMap: + name: kube-root-ca.crt + items: + - key: ca.crt + path: ca.crt - name: prometheus-ca secret: secretName: combined-ca-bundle From 442117e9b63d22341f70c95d5ab82ac1204d0fc7 Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Tue, 10 Nov 2026 17:55:06 +0100 Subject: [PATCH 2/2] nit: Drop stale comment about SA test-operator no longer runs test Pods under the namespace's default ServiceAccount. It creates a dedicated one at test runtime (d649b8e). --- ci/playbooks/install-openstack-lightspeed.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/playbooks/install-openstack-lightspeed.yml b/ci/playbooks/install-openstack-lightspeed.yml index 9d9d167..d96d141 100644 --- a/ci/playbooks/install-openstack-lightspeed.yml +++ b/ci/playbooks/install-openstack-lightspeed.yml @@ -489,7 +489,6 @@ kind: ClusterRole name: lightspeed-access subjects: - # The current test-operator uses the namespace's default account. - kind: ServiceAccount name: "{{ openstack_lightspeed_ansibletest_service_account }}" namespace: "{{ cifmw_test_operator_namespace | default('openstack') }}"