From 251afbcdfb5a3f050921275bca97cb9de9553572 Mon Sep 17 00:00:00 2001 From: Jessica Castelino Date: Mon, 12 Apr 2021 14:51:50 -0400 Subject: [PATCH] Handle "updating" and "recovering" app update states during upgrade activation During simplex subcloud upgrade, if the initial upgrade activation request fails, dcmanager orchestrator re-tries the activation by sending another request (current logic is to retry up to 10 times). On the second upgrade activation request, sysinv skips the oidc-auth-apps reapply as the app is in 'updating' state and proceeds to completing the remaining steps of the activation sequence. As a result, upgrade activation completes while platform apps were either in the incorrect version or incorrect state. This commit resolves the issue by skipping only for "uploaded" and "applied" states during upgrade activation. Change-Id: I4b0aa4897e83a47ccdcf58c37232301f3668de32 Signed-off-by: Jessica Castelino Story: 2008055 Task: 42246 --- .../upgrade-scripts/65-k8s-app-upgrade.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controllerconfig/controllerconfig/upgrade-scripts/65-k8s-app-upgrade.sh b/controllerconfig/controllerconfig/upgrade-scripts/65-k8s-app-upgrade.sh index d0e3394f07..779f32c20a 100644 --- a/controllerconfig/controllerconfig/upgrade-scripts/65-k8s-app-upgrade.sh +++ b/controllerconfig/controllerconfig/upgrade-scripts/65-k8s-app-upgrade.sh @@ -101,8 +101,12 @@ if [ "$FROM_RELEASE" == "20.06" ] && [ "$ACTION" == "activate" ]; then log "$NAME: $EXISTING_APP_NAME, version $EXISTING_APP_VERSION, is currently in the state: $EXISTING_APP_STATUS" if [ "x${UPGRADE_APP_VERSION}" == "x${EXISTING_APP_VERSION}" ]; then - log "$NAME: ${UPGRADE_APP_NAME}, version ${EXISTING_APP_VERSION}, is already present. skipping..." - continue + # If the app is in uploaded or applied state, then we continue with next iteration. + # Else, the code execution proceeds and the script would exit with an unexpected state. + if [[ "${EXISTING_APP_STATUS}" =~ ^(uploaded|applied)$ ]]; then + log "$NAME: ${UPGRADE_APP_NAME}, version ${EXISTING_APP_VERSION}, is already present. skipping..." + continue + fi fi # All applications should be in an 'applied' or 'uploaded' state. Any other state is unexpected