From 5fb0f9967c1a923b72f4929a344bd35b73f56675 Mon Sep 17 00:00:00 2001 From: Pierre Prinetti Date: Thu, 26 Aug 2021 11:15:46 +0200 Subject: [PATCH] CustomNoUpgrade should not fire no-upgrade failures CustomNoUpgrade should be treated just as TechPreviewNoUpgrade, and should not be a condition that triggers no-upgrade failures in tests. This is useful in cases where we want to test a specific set of feature gates in isolation from other tech preview feature gates. Specifically we are using CustomNoUpgrade to test external-cloud-provider CCM promotions in isolation in https://github.com/openshift/release/blob/992f297ef8a1ba749f3a0b9b40438696f18a1bc4/ci-operator/step-registry/ccm/conf/pre-create-feature-gate/ccm-conf-pre-create-feature-gate-commands.sh#L22 Co-Authored-By: Matthew Booth --- test/extended/operators/operators.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/extended/operators/operators.go b/test/extended/operators/operators.go index b28193dcffce..102d9e867975 100644 --- a/test/extended/operators/operators.go +++ b/test/extended/operators/operators.go @@ -63,7 +63,7 @@ var _ = g.Describe("[sig-arch][Early] Managed cluster should", func() { fg := objx.Map(fgObj.UnstructuredContent()) featureSet := fg.Get("spec.featureSet").String() - isTechPreview := featureSet == "TechPreviewNoUpgrade" + isNoUpgrade := featureSet == "TechPreviewNoUpgrade" || featureSet == "CustomNoUpgrade" // gate on all clusteroperators being ready g.By("ensuring all cluster operators are stable") @@ -86,7 +86,7 @@ var _ = g.Describe("[sig-arch][Early] Managed cluster should", func() { // kube-apiserver blocks upgrades when feature gates are present. // Allow testing of TechPreviewNoUpgrade clusters by ignoring this condition. - if isTechPreview && name == "kube-apiserver" && isKubeAPIUpgradableTechPreviewCondition(worstCondition) { + if isNoUpgrade && name == "kube-apiserver" && isKubeAPIUpgradableNoUpgradeCondition(worstCondition) { continue } @@ -252,12 +252,13 @@ func surprisingConditions(co objx.Map) ([]configv1.ClusterOperatorStatusConditio return badConditions, missingTypes } -// When a TechPreviewNoUpgrade feature set is in force in the cluster, the following condition +// When a TechPreviewNoUpgrade or CustomNoUpgrades feature set are in force in the cluster, the following condition // is set on the kube-apiserver cluster operator // Ref: https://github.com/openshift/cluster-kube-apiserver-operator/blob/39a98d67c3b825b9215454a7817ffadb0577609b/pkg/operator/featureupgradablecontroller/feature_upgradeable_controller_test.go#L41-L46 -func isKubeAPIUpgradableTechPreviewCondition(cond configv1.ClusterOperatorStatusCondition) bool { - return cond.Reason == "FeatureGates_RestrictedFeatureGates_TechPreviewNoUpgrade" && +func isKubeAPIUpgradableNoUpgradeCondition(cond configv1.ClusterOperatorStatusCondition) bool { + return (cond.Reason == "FeatureGates_RestrictedFeatureGates_TechPreviewNoUpgrade" || + cond.Reason == "FeatureGates_RestrictedFeatureGates_CustomNoUpgrade") && cond.Status == "False" && cond.Type == "Upgradeable" && - cond.Message == "FeatureGatesUpgradeable: \"TechPreviewNoUpgrade\" does not allow updates" + cond.Message == "FeatureGatesUpgradeable: \"TechPreviewNoUpgrade\" and \"CustomNoUpgrades\" do not allow updates" }