Skip to content

Commit

Permalink
Merge pull request #3465 from jwcesign/fix-2
Browse files Browse the repository at this point in the history
Fixing probability of failure in CLI workflow
  • Loading branch information
karmada-bot committed Apr 26, 2023
2 parents 22fb1d0 + 3dfaa2b commit 0f84dd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hack/cli-testing-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ kubectl wait --for=condition=Ready nodes --all --timeout=800s --kubeconfig=${KUB
util::wait_nodes_taint_disappear 800 ${KUBECONFIG_PATH}/${HOST_CLUSTER_NAME}.config

util::wait_file_exist ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_1_NAME}.config 300
util::wait_context_exist "kind-${MEMBER_CLUSTER_1_NAME}" ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_1_NAME}.config 300
util::wait_context_exist "${MEMBER_CLUSTER_1_NAME}" ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_1_NAME}.config 300
kubectl wait --for=condition=Ready nodes --all --timeout=800s --kubeconfig=${KUBECONFIG_PATH}/${MEMBER_CLUSTER_1_NAME}.config
util::wait_nodes_taint_disappear 800 ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_1_NAME}.config

util::wait_file_exist ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_2_NAME}.config 300
util::wait_context_exist "kind-${MEMBER_CLUSTER_2_NAME}" ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_2_NAME}.config 300
util::wait_context_exist "${MEMBER_CLUSTER_2_NAME}" ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_2_NAME}.config 300
kubectl wait --for=condition=Ready nodes --all --timeout=800s --kubeconfig=${KUBECONFIG_PATH}/${MEMBER_CLUSTER_2_NAME}.config
util::wait_nodes_taint_disappear 800 ${KUBECONFIG_PATH}/${MEMBER_CLUSTER_2_NAME}.config

Expand Down
2 changes: 1 addition & 1 deletion hack/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function util::wait_context_exist() {
local timeout=${3}
local error_msg="[ERROR] Timeout waiting for context exist ${context_name}"
for ((time=0; time<${timeout}; time++)); do
if [[ `grep -c "${context_name}" ${file_path}` -ne '0' ]]; then
if [[ `kubectl config get-contexts ${context_name} --kubeconfig=${file_path}` =~ ${context_name} ]]; then
return 0
fi
sleep 1
Expand Down

0 comments on commit 0f84dd7

Please sign in to comment.