From 0d32a9851ecbc0ee52c968f34c02ef246953ebbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?p=C3=BDrus?= Date: Wed, 13 Nov 2024 20:36:48 +0100 Subject: [PATCH] Fix CSI tests (#2712) --- .../roles/install-csi-cinder/tasks/main.yaml | 19 +++++++++++++++++-- .../roles/install-csi-manila/tasks/main.yaml | 14 +++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/tests/playbooks/roles/install-csi-cinder/tasks/main.yaml b/tests/playbooks/roles/install-csi-cinder/tasks/main.yaml index 19cb1f9b6a..9c28cb0c64 100644 --- a/tests/playbooks/roles/install-csi-cinder/tasks/main.yaml +++ b/tests/playbooks/roles/install-csi-cinder/tasks/main.yaml @@ -26,7 +26,9 @@ cmd: | kubectl -n kube-system get secret cloud-config >/dev/null 2>&1 if [ $? -eq 0 ]; then - exit 0 + kubectl -n kube-system get secrets cloud-config -o json | jq -r '.data."cloud.conf"' | base64 -d + # replacing a cloud-config, created by the OCCM role + kubectl -n kube-system delete secret cloud-config fi set -ex @@ -43,9 +45,12 @@ tenant-id=$tenant_id domain-id=default + [LoadBalancer] + enabled=false EOF kubectl create secret -n kube-system generic cloud-config --from-file={{ ansible_user_dir }}/cloud.conf + kubectl -n kube-system get secrets cloud-config -o json | jq -r '.data."cloud.conf"' | base64 -d - name: Replace manifests shell: @@ -139,11 +144,21 @@ set -x set -e + mkdir -p /var/log/csi-pod kubectl logs deployment/csi-cinder-controllerplugin -n kube-system -c cinder-csi-plugin kubectl logs daemonset/csi-cinder-nodeplugin -n kube-system -c cinder-csi-plugin kubectl logs deployment/csi-cinder-controllerplugin -n kube-system -c cinder-csi-plugin > /var/log/csi-pod/csi-cinder-controllerplugin.log - kubectl logs daemonset/csi-cinder-nodeplugin -n kube-system -c cinder-csi-plugin > /var/log/csi-pod/csi-cinder-nodeplugin.log + kubectl logs daemonset/csi-cinder-nodeplugin -n kube-system -c cinder-csi-plugin > /var/log/csi-pod/csi-cinder-nodeplugin.log + + - name: Show openstack-cloud-controller-manager pod logs + shell: + executable: /bin/bash + cmd: | + kubectl -n kube-system logs ds/openstack-cloud-controller-manager + + kubectl -n kube-system logs ds/openstack-cloud-controller-manager > /var/log/csi-pod/occm.log + - name: &failmsg Stop due to prior failure of csi-cinder-plugin fail: msg: *failmsg diff --git a/tests/playbooks/roles/install-csi-manila/tasks/main.yaml b/tests/playbooks/roles/install-csi-manila/tasks/main.yaml index a95001e650..1d2c02bc1e 100644 --- a/tests/playbooks/roles/install-csi-manila/tasks/main.yaml +++ b/tests/playbooks/roles/install-csi-manila/tasks/main.yaml @@ -26,7 +26,9 @@ cmd: | kubectl -n kube-system get secret cloud-config >/dev/null 2>&1 if [ $? -eq 0 ]; then - exit 0 + kubectl -n kube-system get secrets cloud-config -o json | jq -r '.data."cloud.conf"' | base64 -d + # replacing a cloud-config, created by the OCCM role + kubectl -n kube-system delete secret cloud-config fi set -ex @@ -42,9 +44,13 @@ region=${OS_REGION_NAME} tenant-id=$tenant_id domain-id=default + + [LoadBalancer] + enabled=false EOF kubectl create secret -n kube-system generic cloud-config --from-file={{ ansible_user_dir }}/cloud.conf + kubectl -n kube-system get secrets cloud-config -o json | jq -r '.data."cloud.conf"' | base64 -d - name: Deploy Kubernetes VolumeSnapshot CRDs and snapshot controller shell: @@ -171,6 +177,12 @@ register: describe_csi changed_when: false + - name: Show openstack-cloud-controller-manager pod logs + shell: + executable: /bin/bash + cmd: | + kubectl -n kube-system logs ds/openstack-cloud-controller-manager + - name: Log failed manila-csi-plugin deployment debug: var: describe_csi.stdout_lines