Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issue with force reboot loop #315

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/modules/ROOT/pages/how-tos/force-reboot.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ The exact value doesn't matter, but we want to overwrite the `currentConfig` ann
----
old_mc=$(kubectl get mc -o json | \
jq --arg mcp rendered-$MCP -r \
'[.items[] | select(.metadata.name | contains($mcp))]
| sort_by(.metadata.creationTimestamp) | reverse
'[.items[] | select(.metadata.name | contains($mcp))]
| sort_by(.metadata.creationTimestamp) | reverse
| .[1] | .metadata.name' \
)
----
Expand All @@ -73,15 +73,15 @@ Don't do this for multiple nodes at the same time, all the nodes for which this
timeout=300s <1>
for node in $(kubectl get node -o name -l $node_selector); do
echo "Rebooting $node"
kubectl annotate --overwrite $node \
kubectl --as=cluster-admin annotate --overwrite $node \
machineconfiguration.openshift.io/currentConfig=$old_mc
echo "Waiting for drain... (up to $timeout)"
if !oc wait --timeout=$timeout $node --for condition=notready; then
if ! oc wait --timeout=$timeout $node --for condition=ready=false; then
echo "$node didn't drain and reboot, please check status, aborting loop"
break
fi
echo "Waiting for reboot completed... (up to $timeout)"
if !oc wait --timeout=$timeout $node --for condition=ready; then
if ! oc wait --timeout=$timeout $node --for condition=ready; then
echo "$node didn't become ready, please check status, aborting loop"
break
fi
Expand Down