From cdd758efb72d7a17d9f69e79475fdab0791fafc2 Mon Sep 17 00:00:00 2001 From: "Vanathi.Selvaraju" Date: Fri, 17 Nov 2023 17:59:49 -0500 Subject: [PATCH] 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 --- nfv/nfv-vim/nfv_vim/strategy/_strategy_steps.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nfv/nfv-vim/nfv_vim/strategy/_strategy_steps.py b/nfv/nfv-vim/nfv_vim/strategy/_strategy_steps.py index 3d6a6534..aed277d2 100755 --- a/nfv/nfv-vim/nfv_vim/strategy/_strategy_steps.py +++ b/nfv/nfv-vim/nfv_vim/strategy/_strategy_steps.py @@ -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