You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local boot_id=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output=jsonpath='{.status.nodeInfo.bootID}'2>&1)&& kubectl_rc=$?|| kubectl_rc=$?
305
+
local boot_id
306
+
boot_id=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output=jsonpath='{.status.nodeInfo.bootID}'2>&1)&& kubectl_rc=$?|| kubectl_rc=$?
297
307
if [[ "${kubectl_rc}"!= 0 ]];then
298
308
echo"== FAILED to get bootID ${instance} =="
299
309
echo"${boot_id}"
@@ -313,7 +323,8 @@ function do-single-node-upgrade() {
313
323
# Recreate instance
314
324
echo"== Recreating instance ${instance}. ==">&2
315
325
local recreate_rc
316
-
local recreate=$(gcloud compute instance-groups managed recreate-instances "${group}" \
@@ -329,7 +340,8 @@ function do-single-node-upgrade() {
329
340
# it is a best effort approximation.
330
341
echo"== Waiting for new node to be added to k8s. ==">&2
331
342
whiletrue;do
332
-
local new_boot_id=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output=jsonpath='{.status.nodeInfo.bootID}'2>&1)&& kubectl_rc=$?|| kubectl_rc=$?
343
+
local new_boot_id
344
+
new_boot_id=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output=jsonpath='{.status.nodeInfo.bootID}'2>&1)&& kubectl_rc=$?|| kubectl_rc=$?
333
345
if [[ "${kubectl_rc}"!= 0 ]];then
334
346
echo"== FAILED to get node ${instance} =="
335
347
echo"${boot_id}"
@@ -346,7 +358,8 @@ function do-single-node-upgrade() {
346
358
# Wait for the node to have Ready=True.
347
359
echo"== Waiting for ${instance} to become ready. ==">&2
348
360
whiletrue;do
349
-
local ready=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output='jsonpath={.status.conditions[?(@.type == "Ready")].status}')
361
+
local ready
362
+
ready=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output='jsonpath={.status.conditions[?(@.type == "Ready")].status}')
350
363
if [[ "${ready}"!='True' ]];then
351
364
echo"Node ${instance} is still not ready: Ready=${ready}"
352
365
else
@@ -374,14 +387,14 @@ function do-node-upgrade() {
374
387
# Do the actual upgrade.
375
388
# NOTE(zmerlynn): If you are changing this gcloud command, update
376
389
# test/e2e/cluster_upgrade.go to match this EXACTLY.
377
-
local template_name=$(get-template-name-from-version ${SANITIZED_VERSION}${NODE_INSTANCE_PREFIX})
# We don't want to run more than ${node_upgrade_parallelism} upgrades at a time,
@@ -415,7 +428,7 @@ function do-node-upgrade() {
415
428
if [[ process_count_left -eq 0 ||"${instance}"=="${instances[-1]}" ]];then
416
429
# Wait for each of the parallel node upgrades to finish.
417
430
forpidin"${pids[@]}";do
418
-
wait$pid
431
+
wait"$pid"
419
432
ret_code_sum=$(( ret_code_sum +$?))
420
433
done
421
434
# Return even if at least one of the node upgrades failed.
@@ -430,7 +443,7 @@ function do-node-upgrade() {
430
443
431
444
# Remove the old templates.
432
445
echo"== Deleting old templates in ${PROJECT}. ==">&2
433
-
fortmplin${old_templates[@]};do
446
+
fortmplin"${old_templates[@]}";do
434
447
gcloud compute instance-templates delete \
435
448
--quiet \
436
449
--project="${PROJECT}" \
@@ -455,11 +468,11 @@ function update-coredns-config() {
455
468
456
469
# Get the new installed CoreDNS version
457
470
echo"Waiting for CoreDNS to update"
458
-
until [[ $(${KUBE_ROOT}/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}')-ne${COREDNS_DEPLOY_RESOURCE_VERSION} ]];do
471
+
until [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}')-ne${COREDNS_DEPLOY_RESOURCE_VERSION} ]];do
459
472
sleep 1
460
473
done
461
474
echo"Fetching the latest installed CoreDNS version"
0 commit comments