Skip to content

Commit

Permalink
Don't reboot when upgrading recovery through kubernetes (#1092)
Browse files Browse the repository at this point in the history
because it's not idempotent, the script never returns 0 and thus the
upgrade is restarted after reboot, causing a boot loop.

As described here:

rancher/system-upgrade-controller#23 (comment)

Signed-off-by: Dimitris Karakasilis <[email protected]>
  • Loading branch information
jimmykarily authored Oct 3, 2024
1 parent 496fe60 commit f921c38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/system/suc-upgrade/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: "suc-upgrade"
category: "system"
version: "0.2.2"
version: "0.2.3"
5 changes: 3 additions & 2 deletions packages/system/suc-upgrade/suc-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ while [[ "$#" -gt 0 ]]; do
done
if [ "$recovery_mode" = true ]; then
kairos-agent upgrade --recovery --source dir:/
exit 0 # no need to reboot when upgrading recovery
else
kairos-agent upgrade --source dir:/
nsenter -i -m -t 1 -- reboot
exit 1
fi
nsenter -i -m -t 1 -- reboot
exit 1

0 comments on commit f921c38

Please sign in to comment.