From a3ea9f113a10a90e1dbbc21777c2d5229288369c Mon Sep 17 00:00:00 2001 From: Phan Le Date: Wed, 27 Dec 2023 18:55:00 -0800 Subject: [PATCH] Fix bug failed to find a node that is ready and has the default engine image Wait for the engine image pods to be running before starting the tests longhorn-7413 Signed-off-by: Phan Le --- pipelines/utilities/longhorn_status.sh | 3 ++- test_framework/scripts/longhorn-setup.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pipelines/utilities/longhorn_status.sh b/pipelines/utilities/longhorn_status.sh index 9a0970dbc1..53a4c2e60f 100755 --- a/pipelines/utilities/longhorn_status.sh +++ b/pipelines/utilities/longhorn_status.sh @@ -2,10 +2,11 @@ wait_longhorn_status_running(){ local RETRY_COUNTS=10 # in minutes local RETRY_INTERVAL="1m" - # csi components are installed after longhorn components. + # csi and engine image components are installed after longhorn components. # it's possible that all longhorn components are running but csi components aren't created yet. RETRIES=0 while [[ -z `kubectl get pods -n ${LONGHORN_NAMESPACE} --no-headers 2>&1 | awk '{print $1}' | grep csi-` ]] || \ + [[ -z `kubectl get pods -n ${LONGHORN_NAMESPACE} --no-headers 2>&1 | awk '{print $1}' | grep engine-image-` ]] || \ [[ -n `kubectl get pods -n ${LONGHORN_NAMESPACE} --no-headers 2>&1 | awk '{print $3}' | grep -v "Running\|Completed"` ]]; do echo "Longhorn is still installing ... re-checking in 1m" sleep ${RETRY_INTERVAL} diff --git a/test_framework/scripts/longhorn-setup.sh b/test_framework/scripts/longhorn-setup.sh index 2274677442..ab8c50c986 100755 --- a/test_framework/scripts/longhorn-setup.sh +++ b/test_framework/scripts/longhorn-setup.sh @@ -121,10 +121,11 @@ wait_longhorn_status_running(){ local RETRY_COUNTS=10 # in minutes local RETRY_INTERVAL="1m" - # csi components are installed after longhorn components. + # csi and engine image components are installed after longhorn components. # it's possible that all longhorn components are running but csi components aren't created yet. RETRIES=0 while [[ -z `kubectl get pods -n ${LONGHORN_NAMESPACE} --no-headers 2>&1 | awk '{print $1}' | grep csi-` ]] || \ + [[ -z `kubectl get pods -n ${LONGHORN_NAMESPACE} --no-headers 2>&1 | awk '{print $1}' | grep engine-image-` ]] || \ [[ -n `kubectl get pods -n ${LONGHORN_NAMESPACE} --no-headers 2>&1 | awk '{print $3}' | grep -v Running` ]]; do echo "Longhorn is still installing ... re-checking in 1m" sleep ${RETRY_INTERVAL}