mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
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.
This commit is contained in:
parent
65f8b88f35
commit
bfe9ee9425
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user