mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 05:40:42 +00:00 
			
		
		
		
	fix trivial shell quoting issues surfaced by shellcheck v0.7.1
This commit is contained in:
		| @@ -874,7 +874,7 @@ kube::golang::build_binaries() { | |||||||
|         cat "/tmp//${platform//\//_}.build" |         cat "/tmp//${platform//\//_}.build" | ||||||
|       done |       done | ||||||
|  |  | ||||||
|       exit ${fails} |       exit "${fails}" | ||||||
|     else |     else | ||||||
|       for platform in "${platforms[@]}"; do |       for platform in "${platforms[@]}"; do | ||||||
|         kube::log::status "Building go targets for ${platform}:" "${targets[@]}" |         kube::log::status "Building go targets for ${platform}:" "${targets[@]}" | ||||||
|   | |||||||
| @@ -560,7 +560,7 @@ run_pod_tests() { | |||||||
|   resourceVersion=$(kubectl get "${kube_flags[@]}" pod valid-pod -o go-template='{{ .metadata.resourceVersion }}') |   resourceVersion=$(kubectl get "${kube_flags[@]}" pod valid-pod -o go-template='{{ .metadata.resourceVersion }}') | ||||||
|   ((resourceVersion+=100)) |   ((resourceVersion+=100)) | ||||||
|   # Command |   # Command | ||||||
|   kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]},"metadata":{"resourceVersion":"'$resourceVersion'"}}' 2> "${ERROR_FILE}" || true |   kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]},"metadata":{"resourceVersion":"'"$resourceVersion"'"}}' 2> "${ERROR_FILE}" || true | ||||||
|   # Post-condition: should get an error reporting the conflict |   # Post-condition: should get an error reporting the conflict | ||||||
|   if grep -q "please apply your changes to the latest version and try again" "${ERROR_FILE}"; then |   if grep -q "please apply your changes to the latest version and try again" "${ERROR_FILE}"; then | ||||||
|     kube::log::status "\"kubectl patch with resourceVersion $resourceVersion\" returns error as expected: $(cat "${ERROR_FILE}")" |     kube::log::status "\"kubectl patch with resourceVersion $resourceVersion\" returns error as expected: $(cat "${ERROR_FILE}")" | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ for peer in "${PEERS[@]}"; do | |||||||
|     if [[ "${peer}" == *"${HOSTNAME}"* ]]; then |     if [[ "${peer}" == *"${HOSTNAME}"* ]]; then | ||||||
|       MY_ID=$i |       MY_ID=$i | ||||||
|       MY_NAME=${peer} |       MY_NAME=${peer} | ||||||
|       echo $i > "${MY_ID_FILE}" |       echo "$i" > "${MY_ID_FILE}" | ||||||
|       echo "server.${i}=${peer}:2888:3888:observer;2181" >> "${CFG_BAK}" |       echo "server.${i}=${peer}:2888:3888:observer;2181" >> "${CFG_BAK}" | ||||||
|     else |     else | ||||||
|       if [[ $(echo srvr | /opt/nc "${peer}" 2181 | grep Mode) = "Mode: leader" ]]; then |       if [[ $(echo srvr | /opt/nc "${peer}" 2181 | grep Mode) = "Mode: leader" ]]; then | ||||||
| @@ -95,10 +95,10 @@ ADD_SERVER="server.$MY_ID=$MY_NAME:2888:3888:participant;0.0.0.0:2181" | |||||||
| # Prove that we've actually joined the running cluster | # Prove that we've actually joined the running cluster | ||||||
| ITERATION=0 | ITERATION=0 | ||||||
| until echo config | /opt/nc localhost 2181 | grep "${ADD_SERVER}" > /dev/null; do | until echo config | /opt/nc localhost 2181 | grep "${ADD_SERVER}" > /dev/null; do | ||||||
|   echo $ITERATION] waiting for updated config to sync back to localhost |   echo "$ITERATION"] waiting for updated config to sync back to localhost | ||||||
|   sleep 1 |   sleep 1 | ||||||
|   (( ITERATION=ITERATION+1 )) |   (( ITERATION=ITERATION+1 )) | ||||||
|   if [ $ITERATION -eq 20 ]; then |   if [ "$ITERATION" -eq 20 ]; then | ||||||
|     exit 1 |     exit 1 | ||||||
|   fi |   fi | ||||||
| done | done | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user