Skip to content

Commit f3111e3

Browse files
gcs278claude
andcommitted
Fix isNoOLMFeatureGateEnabled to check only the current cluster version
The FeatureGate CR status.featureGates contains entries for each cluster version. After an upgrade, entries for both the old and new versions exist. isNoOLMFeatureGateEnabled was iterating all version entries, so it could incorrectly return true by finding the gate enabled in a pre-upgrade version's entry, even though the current version has it disabled. This caused the e2e-upgrade-out-of-change test to fail because it expected a sail finalizer that the CIO had already removed during the downgrade path. Fix this by looking up the current cluster version from ClusterVersion status.desired.version and only checking the matching featureGates entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 293edc7 commit f3111e3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

test/extended/router/gatewayapicontroller.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,18 +643,28 @@ func isIPv6OrDualStack(oc *exutil.CLI) (bool, error) {
643643
}
644644

645645
func isNoOLMFeatureGateEnabled(oc *exutil.CLI) (bool, error) {
646+
cv, err := oc.AdminConfigClient().ConfigV1().ClusterVersions().Get(context.TODO(), "version", metav1.GetOptions{})
647+
if err != nil {
648+
return false, fmt.Errorf("failed to get ClusterVersion: %v", err)
649+
}
650+
currentVersion := cv.Status.Desired.Version
651+
646652
fgs, err := oc.AdminConfigClient().ConfigV1().FeatureGates().Get(context.TODO(), "cluster", metav1.GetOptions{})
647653
if err != nil {
648654
return false, fmt.Errorf("failed to get cluster FeatureGates: %v", err)
649655
}
650656
for _, fg := range fgs.Status.FeatureGates {
657+
if fg.Version != currentVersion {
658+
continue
659+
}
651660
for _, enabledFG := range fg.Enabled {
652661
if enabledFG.Name == "GatewayAPIWithoutOLM" {
653-
e2e.Logf("GatewayAPIWithoutOLM featuregate is enabled")
662+
e2e.Logf("GatewayAPIWithoutOLM featuregate is enabled for version %s", currentVersion)
654663
return true, nil
655664
}
656665
}
657666
}
667+
e2e.Logf("GatewayAPIWithoutOLM featuregate is not enabled for version %s", currentVersion)
658668
return false, nil
659669
}
660670

0 commit comments

Comments
 (0)