mirror of https://github.com/k3s-io/k3s
Use bash ranges "{1..3}" instead of "$(seq 1 3)".
parent
364f2da548
commit
5508e49ef5
|
@ -1547,7 +1547,7 @@ function ssh-to-node {
|
|||
|
||||
local ip=$(get_ssh_hostname ${node})
|
||||
|
||||
for try in $(seq 1 5); do
|
||||
for try in {1..5}; do
|
||||
if ssh -oLogLevel=quiet -oConnectTimeout=30 -oStrictHostKeyChecking=no -i "${AWS_SSH_KEY}" ${SSH_USER}@${ip} "echo test > /dev/null"; then
|
||||
break
|
||||
fi
|
||||
|
|
|
@ -1533,7 +1533,7 @@ function ssh-to-node {
|
|||
local node="$1"
|
||||
local cmd="$2"
|
||||
# Loop until we can successfully ssh into the box
|
||||
for try in $(seq 1 5); do
|
||||
for try in {1..5}; do
|
||||
if gcloud compute ssh --ssh-flag="-o LogLevel=quiet" --ssh-flag="-o ConnectTimeout=30" --project "${PROJECT}" --zone="${ZONE}" "${node}" --command "echo test > /dev/null"; then
|
||||
break
|
||||
fi
|
||||
|
|
|
@ -339,7 +339,7 @@ function ssh-to-node() {
|
|||
local node="$1"
|
||||
local cmd="$2"
|
||||
# Loop until we can successfully ssh into the box
|
||||
for try in $(seq 1 5); do
|
||||
for try in {1..5}; do
|
||||
if gcloud compute ssh --ssh-flag="-o LogLevel=quiet" --ssh-flag="-o ConnectTimeout=30" --project "${PROJECT}" --zone="${ZONE}" "${node}" --command "echo test > /dev/null"; then
|
||||
break
|
||||
fi
|
||||
|
|
|
@ -284,7 +284,7 @@ function pc-create-vm {
|
|||
|
||||
# Wait for the VM to be started and connected to the network
|
||||
have_network=0
|
||||
for i in $(seq 120); do
|
||||
for i in {1..120}; do
|
||||
# photon -n vm networks print several fields:
|
||||
# NETWORK MAC IP GATEWAY CONNECTED?
|
||||
# We wait until CONNECTED is True
|
||||
|
|
|
@ -230,7 +230,7 @@ $kubectl create -f bps-load-gen-rc.json --namespace=$NS
|
|||
#This script assumes the cloud provider is able to create a load balancer. If this not the case, you may want to check out other ways to make the frontend service accessible from outside (https://github.com/kubernetes/kubernetes/blob/master/docs/services.md#external-services)
|
||||
function getIP {
|
||||
echo "Waiting up to 1 min for a public IP to be assigned by the cloud provider..."
|
||||
for i in `seq 1 20`;
|
||||
for i in {1..20};
|
||||
do
|
||||
PUBLIC_IP=$($kubectl get services/frontend --namespace=$NS -o template --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}")
|
||||
if [ -n "$PUBLIC_IP" ]; then
|
||||
|
@ -249,7 +249,7 @@ function pollfor {
|
|||
pass_http=0
|
||||
|
||||
### Test HTTP Server comes up.
|
||||
for i in `seq 1 150`;
|
||||
for i in {1..150};
|
||||
do
|
||||
### Just testing that the front end comes up. Not sure how to test total entries etc... (yet)
|
||||
echo "Trying curl ... $PUBLIC_IP:3000 , attempt $i . expect a few failures while pulling images... "
|
||||
|
|
|
@ -267,7 +267,7 @@ function pollfor {
|
|||
pass_http=0
|
||||
|
||||
### Test HTTP Server comes up.
|
||||
for i in `seq 1 150`;
|
||||
for i in {1..150};
|
||||
do
|
||||
### Just testing that the front end comes up. Not sure how to test total entries etc... (yet)
|
||||
echo "Trying curl frontend:3000 via $TEST_IP:$NODE_PORT, attempt ${i}. Expect a few failures while pulling images... "
|
||||
|
|
|
@ -233,7 +233,7 @@ function pollfor {
|
|||
pass_http=0
|
||||
|
||||
### Test HTTP Server comes up.
|
||||
for i in `seq 1 150`;
|
||||
for i in {1..150};
|
||||
do
|
||||
### Just testing that the front end comes up. Not sure how to test total entries etc... (yet)
|
||||
echo "Trying curl ... $PUBLIC_IP:3000 , attempt $i . expect a few failures while pulling images... "
|
||||
|
|
|
@ -236,7 +236,7 @@ fi
|
|||
if [[ -n "${CLOUDSDK_BUCKET:-}" ]]; then
|
||||
# Retry the download a few times to mitigate transient server errors and
|
||||
# race conditions where the bucket contents change under us as we download.
|
||||
for n in $(seq 3); do
|
||||
for n in {1..3}; do
|
||||
gsutil -mq cp -r "${CLOUDSDK_BUCKET}" ~ && break || sleep 1
|
||||
# Delete any temporary files from the download so that we start from
|
||||
# scratch when we retry.
|
||||
|
|
|
@ -86,7 +86,7 @@ function upload_version() {
|
|||
fi
|
||||
|
||||
local -r json_file="${gcs_build_path}/started.json"
|
||||
for upload_attempt in $(seq 3); do
|
||||
for upload_attempt in {1..3}; do
|
||||
echo "Uploading version to: ${json_file} (attempt ${upload_attempt})"
|
||||
gsutil -q -h "Content-Type:application/json" cp -a "${gcs_acl}" <(
|
||||
echo "{"
|
||||
|
@ -103,7 +103,7 @@ function upload_artifacts_and_build_result() {
|
|||
local -r build_result=$1
|
||||
echo -n 'Run finished at '; date -d "@${timestamp}"
|
||||
|
||||
for upload_attempt in $(seq 3); do
|
||||
for upload_attempt in {1..3}; do
|
||||
echo "Uploading to ${gcs_build_path} (attempt ${upload_attempt})"
|
||||
echo "Uploading build result: ${build_result}"
|
||||
gsutil -q -h "Content-Type:application/json" cp -a "${gcs_acl}" <(
|
||||
|
|
|
@ -110,7 +110,7 @@ function kubectl-with-retry()
|
|||
{
|
||||
ERROR_FILE="${KUBE_TEMP}/kubectl-error"
|
||||
preserve_err_file=${PRESERVE_ERR_FILE-false}
|
||||
for count in $(seq 0 3); do
|
||||
for count in {0..3}; do
|
||||
kubectl "$@" 2> ${ERROR_FILE} || true
|
||||
if grep -q "the object has been modified" "${ERROR_FILE}"; then
|
||||
kube::log::status "retry $1, error: $(cat ${ERROR_FILE})"
|
||||
|
@ -694,7 +694,7 @@ runTests() {
|
|||
## If the resourceVersion is the same as the one stored in the server, the patch will be applied.
|
||||
# Command
|
||||
# Needs to retry because other party may change the resource.
|
||||
for count in $(seq 0 3); do
|
||||
for count in {0..3}; do
|
||||
resourceVersion=$(kubectl get "${kube_flags[@]}" pod valid-pod -o go-template='{{ .metadata.resourceVersion }}')
|
||||
kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]},"metadata":{"resourceVersion":"'$resourceVersion'"}}' 2> "${ERROR_FILE}" || true
|
||||
if grep -q "the object has been modified" "${ERROR_FILE}"; then
|
||||
|
|
Loading…
Reference in New Issue