Merge pull request #82413 from zhlhahaha/kube-proxy-error

local-up-cluster kube-proxy terminated error
This commit is contained in:
Kubernetes Prow Robot
2019-10-12 07:48:37 -07:00
committed by GitHub
2 changed files with 40 additions and 3 deletions

View File

@@ -64,6 +64,24 @@ kube::util::wait_for_url() {
return 1
}
# Example: kube::util::wait_for_success 120 5 "kubectl get nodes|grep localhost"
# arguments: wait time, sleep time, shell command
# returns 0 if the shell command get output, 1 otherwise.
kube::util::wait_for_success(){
local wait_time="$1"
local sleep_time="$2"
local cmd="$3"
while [ "$wait_time" -gt 0 ]; do
if eval "$cmd"; then
return 0
else
sleep "$sleep_time"
wait_time=$((wait_time-sleep_time))
fi
done
return 1
}
# Example: kube::util::trap_add 'echo "in trap DEBUG"' DEBUG
# See: http://stackoverflow.com/questions/3338030/multiple-bash-traps-for-the-same-signal
kube::util::trap_add() {