Skip to content

Commit

Permalink
feature(sct_config): save upgrade version
Browse files Browse the repository at this point in the history
add logic to save the target version, so
we can fix the name of the product being use from 2025.1 and onwards
  • Loading branch information
fruch committed Jan 20, 2025
1 parent 8f9f9d5 commit b3b2e60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sdcm/sct_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,7 @@ def __init__(self): # noqa: PLR0912, PLR0914, PLR0915
# pylint: disable=too-many-locals,too-many-branches,too-many-statements
super().__init__()
self.scylla_version = None
self.scylla_version_upgrade_target = None
self.is_enterprise = False

self.log = logging.getLogger(__name__)
Expand Down Expand Up @@ -2450,6 +2451,7 @@ def _get_target_upgrade_version(self):
if not self.get('target_upgrade_version'):
self['target_upgrade_version'] = get_branch_version(new_scylla_repo)
scylla_version = get_branch_version(new_scylla_repo, full_version=True)
self.scylla_version_upgrade_target = scylla_version
self.update_argus_with_version(scylla_version, "scylla-server-upgrade-target")

def _check_unexpected_sct_variables(self):
Expand Down
12 changes: 11 additions & 1 deletion upgrade_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
from sdcm.utils.user_profile import get_profile_content
from sdcm.utils.version_utils import (
get_node_supported_sstable_versions,
get_node_enabled_sstable_version
get_node_enabled_sstable_version,
ComparableScyllaVersion,
)
from sdcm.sct_events.system import InfoEvent
from sdcm.sct_events.database import (
Expand Down Expand Up @@ -286,6 +287,15 @@ def _upgrade_node(self, node, upgrade_sstables=True, new_scylla_repo=None, new_v
scylla_pkg = 'scylla-enterprise' if new_is_enterprise else 'scylla'
ver_suffix = r'\*{}'.format(new_version) if new_version else ''
scylla_pkg_ver = f"{scylla_pkg}{ver_suffix}"

InfoEvent(message=f'upgrade_node - target version={self.params.scylla_version_upgrade_target}').publish()
if ComparableScyllaVersion(self.params.scylla_version_upgrade_target) >= '2025.1.0~dev':
scylla_pkg = 'scylla'
scylla_pkg_ver = f"{scylla_pkg}{ver_suffix}"
self.upgrade_rollback_mode = 'reinstall'
if self.params.get('use_preinstalled_scylla'):
scylla_pkg_ver += f" {scylla_pkg}-machine-image{ver_suffix}"

if orig_is_enterprise != new_is_enterprise:
self.upgrade_rollback_mode = 'reinstall'
if self.params.get('use_preinstalled_scylla'):
Expand Down

0 comments on commit b3b2e60

Please sign in to comment.