Do not install N+1 release unless upgrade in progress

During upgrade, installer RPMs from release N need to be installed
to host (release N+1).
During downgrade, installer RPMs from release N+1 don't need to be
installed to host (release N)
Currently installer from "the other release" is installed to host
regardless an upgrade is in progress or no by kickstarts. This
requires the kickstarts on release N to understand the structure of
installer RPM of future release. The installer from "the other
release" only useful is when an upgrade is in progress (to provide
installer when downgrade is required).

This change removes the step to install RPMs from other release to
host when upgrade is not in progress.

TCs:
    Upgrade from 21.05 -> 21.12 abort after controller-1
        upgrade completed
    Upgrade from 21.05 -> 21.12
    Upgrade from 21.12 -> 22.02 abort after controller-1
        upgrade completed
    Upgrade from 21.12 -> 22.02
    load delete after 21.05 -> 21.12 upgrade abort
    load delete after 21.05 -> 21.12 upgrade complete
    load delete after 21.12 -> 22.02 upgrade abort
    load delete after 21.12 -> 22.02 upgrade complete

Depends-on: https://review.opendev.org/c/starlingx/config/+/829943
Closes-bug: 1961424

Change-Id: I86edbe09410d3df9b9440d89208af90f0eb1fd09
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
Bin Qian 2022-02-10 10:26:48 -05:00
parent 3edbb7f778
commit 46f41901d6
1 changed files with 42 additions and 40 deletions

View File

@ -34,6 +34,7 @@ echo "Done" >/dev/console
shopt -s nullglob
if [ "$(curl -sf http://pxecontroller:6385/v1/upgrade/$(hostname)/upgrade_in_progress 2>/dev/null)" = "true" ]; then
# Check whether a second release is installed
. /etc/build.info
CURRENT_REL_DIR=rel-${SW_VERSION}
@ -76,5 +77,6 @@ if [ ! -z "$OTHER_REL_DIR" ]; then
rm -rf $TMP_RPM
fi
fi
%end