Restrict legacy patch check to stx-8 or less

During USM upgrade to stx-10, when the second controller
is upgraded, the active controller legacy patch controller
change from-release Applied patches to Partial-Apply state,
because the sysroot ostree commit-id changes on the second
controller and doesn't match the previous patches commits
anymore.

This commit restricts legacy patch API checks/changes to
hosts running stx-8 or less, where legacy patch API is valid.
On post stx-8 releases USM is the new patch API.

Test Plan
PASS: AIO-SX stx-8 -> stx-10 upgrade,
      verify patch state is consistent
PASS: AIO-SX stx-10 -> stx-8 rollback,
      verify patch state is consistent
PASS: STD, same as previous TCs

Closes-bug: 2093202

Change-Id: I1e79d354cafd9d6db12c6b1d0164bd4000137c23
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
This commit is contained in:
Heitor Matsui
2025-01-07 12:25:28 -03:00
parent de60f803f9
commit b770638c79

View File

@@ -1,5 +1,5 @@
"""
Copyright (c) 2014-2022 Wind River Systems, Inc.
Copyright (c) 2014-2025 Wind River Systems, Inc.
SPDX-License-Identifier: Apache-2.0
@@ -18,6 +18,7 @@ import tarfile
import tempfile
import threading
import time
from packaging import version
from wsgiref import simple_server
from oslo_config import cfg as oslo_cfg
@@ -829,6 +830,14 @@ class PatchController(PatchService):
self.patch_data.metadata[patch_id]["patchstate"] = constants.UNKNOWN
return
# If the active controller running release > 22.12 then it
# should not check or change legacy patch API states
try:
if version.Version(SW_VERSION) > version.Version("22.12"):
return
except Exception as e:
LOG.warning("Unable to identify running release: %s", str(e))
# Default to allowing in-service patching
self.allow_insvc_patching = True