From bfe9ee94258b407c3685458d146147b91ca0fa39 Mon Sep 17 00:00:00 2001 From: Kris Date: Fri, 11 May 2018 09:57:04 -0700 Subject: [PATCH] Move uncordon to after the node is ready It is possible that the node API object doesn't exist in a brief window between recreation and registering. By moving the uncordon until after the node is ready, we can be sure the API object exists. --- cluster/gce/upgrade.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh index 0a44596d683..ad311e45519 100755 --- a/cluster/gce/upgrade.sh +++ b/cluster/gce/upgrade.sh @@ -342,16 +342,6 @@ function do-single-node-upgrade() { sleep 1 done - # Uncordon the node. - echo "== Uncordon ${instance}. == " >&2 - local uncordon_rc - "${KUBE_ROOT}/cluster/kubectl.sh" uncordon "${instance}" \ - && uncordon_rc=$? || uncordon_rc=$? - if [[ "${uncordon_rc}" != 0 ]]; then - echo "== FAILED to uncordon ${instance} ==" - return ${uncordon_rc} - fi - # Wait for the node to have Ready=True. echo "== Waiting for ${instance} to become ready. ==" >&2 while true; do @@ -364,6 +354,16 @@ function do-single-node-upgrade() { fi sleep 1 done + + # Uncordon the node. + echo "== Uncordon ${instance}. == " >&2 + local uncordon_rc + "${KUBE_ROOT}/cluster/kubectl.sh" uncordon "${instance}" \ + && uncordon_rc=$? || uncordon_rc=$? + if [[ "${uncordon_rc}" != 0 ]]; then + echo "== FAILED to uncordon ${instance} ==" + return ${uncordon_rc} + fi } # Prereqs: