public static bool ShouldReportUnhealthy(ClusterUpgradeStateBase upgradeState, UpgradeFlow currentUpgradeFlow, FaultInjectionConfig faultInjectionConfig) { MultiphaseClusterUpgradeState multiPhaseUpgradeState = upgradeState as MultiphaseClusterUpgradeState; int currentStep = 0; if (multiPhaseUpgradeState != null) { currentStep = multiPhaseUpgradeState.CurrentListIndex; } return(faultInjectionConfig.Equals(new FaultInjectionConfig(currentUpgradeFlow, currentStep))); }
public static UpgradeFlow GetUpgradeFlow(ClusterUpgradeStateBase upgradeState) { MultiphaseClusterUpgradeState multiPhaseUpgradeState = upgradeState as MultiphaseClusterUpgradeState; if (multiPhaseUpgradeState != null && multiPhaseUpgradeState.UpgradeUnsuccessful) { return(UpgradeFlow.RollingBack); } else { return(UpgradeFlow.RollingForward); } }