Skip to content

Commit

Permalink
Fix upgrade between 3.2.2 versions and older (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka authored Nov 13, 2024
1 parent b047f46 commit 86cbb08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/system/suc-upgrade/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
image: "alpine"

steps:
- cp -rfv suc-upgrade.sh /usr/sbin/suc-upgrade && chmod +x /usr/sbin/suc-upgrade
- cp -rfv suc-upgrade.sh /usr/sbin/suc-upgrade && chmod +x /usr/sbin/suc-upgrade
# set the SUC_VERSION key in the script to the package version
- sed -i "s/SUC_VERSION=.*/SUC_VERSION=${PACKAGE_VERSION}/" /usr/sbin/suc-upgrade
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.3.0"
version: "0.3.1"
5 changes: 4 additions & 1 deletion packages/system/suc-upgrade/suc-upgrade.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
set -x -e
HOST_DIR="${HOST_DIR:-/host}"
SUC_VERSION="0.0.0"

echo "SUC_VERSION: $SUC_VERSION"

if [ "$FORCE" != "true" ]; then
if [ -f "/etc/kairos-release" ]; then
Expand All @@ -11,7 +14,7 @@ if [ "$FORCE" != "true" ]; then
UPDATE_VERSION=$(source /etc/os-release && echo "${KAIROS_VERSION}")
fi

if [ -f "/etc/kairos-release" ]; then
if [ -f "${HOST_DIR}/etc/kairos-release" ]; then
# shellcheck disable=SC1091
CURRENT_VERSION=$(source "${HOST_DIR}"/etc/kairos-release && echo "${KAIROS_VERSION}")
else
Expand Down

0 comments on commit 86cbb08

Please sign in to comment.