Post K8s upgrade DC system controller swacts in a loop

After K8s upgrade from 1.22 to 1.23 the system
swacts in a loop, this occurs as an atrribute
of the VIM object is not available leading to
multiple restarts of VIM service resulting
in swact.

Test Plan:
PASSED: Induce condition Kube upgrade object null state
causing vim restarts, apply fix, system stabilizes.

Closes-Bug: 2043859

Change-Id: Iccb3106cade1308aa6e9232013366c2b9181557b
Signed-off-by: Vanathi.Selvaraju <vanathi.selvaraju@windriver.com>
This commit is contained in:
Vanathi.Selvaraju 2023-11-17 17:59:49 -05:00
parent 9feef4232d
commit cdd758efb7

View File

@ -3997,7 +3997,7 @@ class AbstractKubeUpgradeStep(AbstractStrategyStep):
self.strategy.nfvi_kube_upgrade = kube_upgrade_obj
# break out of the loop if fail or success states match
if kube_upgrade_obj.state == self._success_state:
if kube_upgrade_obj and kube_upgrade_obj.state == self._success_state:
DLOG.debug("(%s) successfully reached (%s)."
% (self._name, self._success_state))
result = strategy.STRATEGY_STEP_RESULT.SUCCESS
@ -4014,9 +4014,13 @@ class AbstractKubeUpgradeStep(AbstractStrategyStep):
else:
# Keep waiting for upgrade to reach success or fail state
# timeout will occur if it is never reached.
if kube_upgrade_obj:
kube_upgrade_obj_state = kube_upgrade_obj.state
else:
kube_upgrade_obj_state = None
DLOG.debug("(%s) in state (%s) waiting for (%s) or (%s)."
% (self._name,
kube_upgrade_obj.state,
kube_upgrade_obj_state,
self._success_state,
self._fail_state))
pass