Merge pull request #568 from lfbear/pr_pod_waittime_tuning

CI: Reduce pod wait time  and the number of retries
This commit is contained in:
karmada-bot 2021-07-30 17:10:56 +08:00 committed by GitHub
commit 237cc06920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -238,9 +238,13 @@ function util::wait_pod_ready() {
echo "wait the $pod_label ready..."
set +e
util::kubectl_with_retry wait --for=condition=Ready --timeout=200s pods -l app=${pod_label} -n ${pod_namespace}
util::kubectl_with_retry wait --for=condition=Ready --timeout=30s pods -l app=${pod_label} -n ${pod_namespace}
ret=$?
set -e
if [ $ret -ne 0 ];then
echo "kubectl describe info:"
kubectl describe pod -l app=${pod_label} -n ${pod_namespace}
fi
return ${ret}
}
@ -248,11 +252,11 @@ function util::wait_pod_ready() {
# tolerate kubectl command failure that may happen before the pod is created by StatefulSet/Deployment.
function util::kubectl_with_retry() {
local ret=0
for i in `seq 1 30`; do
for i in {1..10}; do
kubectl "$@"
ret=$?
if [[ ${ret} -ne 0 ]]; then
echo "kubectl $@ failed, retrying"
echo "kubectl $@ failed, retrying(${i} times)"
sleep 1
continue
else