Don't reboot when upgrading recovery through kubernetes (#1092)

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:

https://github.com/rancher/system-upgrade-controller/issues/23#issuecomment-583003758

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis 2024-10-03 16:21:05 +03:00 committed by GitHub
parent 496fe60947
commit f921c38c44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,3 @@
name: "suc-upgrade"
category: "system"
version: "0.2.2"
version: "0.2.3"

View File

@ -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