summaryrefslogtreecommitdiffstats
path: root/kud/tests/_functions.sh
diff options
context:
space:
mode:
authorTodd Malsbary <todd.malsbary@intel.com>2022-01-19 13:54:14 -0800
committerTodd Malsbary <todd.malsbary@intel.com>2022-01-19 13:54:14 -0800
commit1f92a0ec4ea037089b82e3f80bb030f34fab64f0 (patch)
tree1a245e9f2a605910c8cec327d06165d6a532946a /kud/tests/_functions.sh
parent0dd494c4953bf9f910bc1d16fe96db83f03f2fb7 (diff)
Use kubectl wait in KuD wait_for_pod test function
This handles intermittent Err* Pod status such as ErrImagePull. Additionally, remove the duplication of wait_for_pod among the tests. Issue-ID: MULTICLOUD-1435 Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> Change-Id: I70c69e0427b80e31b2f97515ebdbc3496a91ced1
Diffstat (limited to 'kud/tests/_functions.sh')
-rwxr-xr-xkud/tests/_functions.sh15
1 files changed, 2 insertions, 13 deletions
diff --git a/kud/tests/_functions.sh b/kud/tests/_functions.sh
index 367888e5..e2d92079 100755
--- a/kud/tests/_functions.sh
+++ b/kud/tests/_functions.sh
@@ -223,24 +223,13 @@ function wait_deployment {
done
}
-# wait_for_pod() - Wait until first pod matched by kubectl filters is in running status
+# wait_for_pod() - Wait until pods matched by kubectl filters is in running status
function wait_for_pod {
#Example usage:
# wait_for_pods example_pod
# wait_for_pods --namespace test different_pod
# wait_for_pods -n test -l app=plugin_test
-
- status_phase=""
- while [[ "$status_phase" != "Running" ]]; do
- new_phase="$(kubectl get pods -o 'go-template={{ index .items 0 "status" "phase" }}' "$@" )"
- if [[ "$new_phase" != "$status_phase" ]]; then
- echo "$(date +%H:%M:%S) - Filter=[$*] : $new_phase"
- status_phase="$new_phase"
- fi
- if [[ "$new_phase" == "Err"* ]]; then
- exit 1
- fi
- done
+ kubectl wait --for=condition=Ready --timeout=600s pod "$@"
}
# wait_for_deployment() - Wait until the deployment is ready