From 20f962fc009af5ea9d3b587eb72b55e3a1a7ea45 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Wed, 5 Jul 2023 14:49:18 +0530 Subject: [PATCH] ci: fix ci test encryption-pvc-kms-vault-token-auth we need to wait for the rgw pod to be delete and not only the cephobjectsore, sometime the pod could be in terminating state. Also, in some place it require proper command to wait for pod to be ready/delete and get the pod name only. Signed-off-by: subhamkrai (cherry picked from commit 70f29be748cda0d6acec3411efc70dc882e8c5a2) --- .github/workflows/canary-integration-test.yml | 2 ++ tests/scripts/deploy-validate-vault.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index f8bdc4766..56908cce5 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -972,6 +972,8 @@ jobs: kubectl delete -f tests/manifests/test-object.yaml yq write -i tests/manifests/test-object.yaml "spec.security.kms.connectionDetails.VAULT_SECRET_ENGINE" transit timeout 120 bash -c 'while kubectl -n rook-ceph get cephobjectstore my-store; do echo "waiting for objectstore my-store to delete"; sleep 5; done' + echo "wait for rgw pod to be deleted" + kubectl wait --for=delete pod -l app=rook-ceph-rgw -n rook-ceph --timeout=100s kubectl create -f tests/manifests/test-object.yaml tests/scripts/validate_cluster.sh rgw tests/scripts/deploy-validate-vault.sh validate_rgw diff --git a/tests/scripts/deploy-validate-vault.sh b/tests/scripts/deploy-validate-vault.sh index da10a1a20..df793a07e 100755 --- a/tests/scripts/deploy-validate-vault.sh +++ b/tests/scripts/deploy-validate-vault.sh @@ -167,7 +167,9 @@ function deploy_vault { } function validate_rgw_token { - RGW_POD=$(kubectl -n rook-ceph get pods -l app=rook-ceph-rgw | awk 'FNR == 2 {print $1}') + echo "wait for rgw pod to be ready" + kubectl wait --for=condition=ready pod -l app=rook-ceph-rgw -n rook-ceph --timeout=100s + RGW_POD=$(kubectl get pods -l app=rook-ceph-rgw -n rook-ceph --no-headers -o custom-columns=":metadata.name") RGW_TOKEN_FILE=$(kubectl -n rook-ceph describe pods "$RGW_POD" | grep "rgw-crypt-vault-token-file" | cut -f2- -d=) VAULT_PATH_PREFIX=$(kubectl -n rook-ceph describe pods "$RGW_POD" | grep "rgw-crypt-vault-prefix" | cut -f2- -d=) VAULT_TOKEN=$(kubectl -n rook-ceph exec $RGW_POD -- cat $RGW_TOKEN_FILE)