mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #63616 from krousey/node-upgrade
Automatic merge from submit-queue (batch tested with PRs 62665, 62194, 63616, 63672, 63450). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Uncordon the node after upgrade **What this PR does / why we need it**: Previous logic was relying on the node to recreate the node API object and, as a side-effect, uncordon itself. A change went in that no longer ensures the node recreates itself, so the bug in this logic was exposed. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #63506 **Special notes for your reviewer**: **Release note**: ```release-note NONE ``` cc @dchen1107 @AishSundar
This commit is contained in:
commit
1fe589fbb7
@ -342,15 +342,21 @@ function do-single-node-upgrade() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Wait for the node to not have SchedulingDisabled=True and also to have
|
# Uncordon the node.
|
||||||
# Ready=True.
|
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
|
echo "== Waiting for ${instance} to become ready. ==" >&2
|
||||||
while true; do
|
while true; do
|
||||||
local cordoned=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output='jsonpath={.status.conditions[?(@.type == "SchedulingDisabled")].status}')
|
|
||||||
local ready=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output='jsonpath={.status.conditions[?(@.type == "Ready")].status}')
|
local ready=$("${KUBE_ROOT}/cluster/kubectl.sh" get node "${instance}" --output='jsonpath={.status.conditions[?(@.type == "Ready")].status}')
|
||||||
if [[ "${cordoned}" == 'True' ]]; then
|
if [[ "${ready}" != 'True' ]]; then
|
||||||
echo "Node ${instance} is still not ready: SchedulingDisabled=${ready}"
|
|
||||||
elif [[ "${ready}" != 'True' ]]; then
|
|
||||||
echo "Node ${instance} is still not ready: Ready=${ready}"
|
echo "Node ${instance} is still not ready: Ready=${ready}"
|
||||||
else
|
else
|
||||||
echo "Node ${instance} Ready=${ready}"
|
echo "Node ${instance} Ready=${ready}"
|
||||||
|
Loading…
Reference in New Issue
Block a user