Skip to content

Commit e521925

Browse files
committed
OCPBUGS-55317: Skip GatewayAPIController tests on clusters without OLM capabilities
This ensures GatewayAPIController tests are only run on clusters where OLM and related capabilities are enabled.
1 parent 8cd52ac commit e521925

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/extended/router/gatewayapicontroller.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ import (
2626
gatewayapiclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned"
2727
)
2828

29+
var (
30+
requiredCapabilities = []configv1.ClusterVersionCapability{
31+
configv1.ClusterVersionCapabilityMarketplace,
32+
configv1.ClusterVersionCapabilityOperatorLifecycleManager,
33+
}
34+
)
35+
2936
var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feature:Router][apigroup:gateway.networking.k8s.io]", g.Ordered, g.Serial, func() {
3037
defer g.GinkgoRecover()
3138
var (
@@ -73,14 +80,18 @@ var _ = g.Describe("[sig-network-edge][OCPFeatureGate:GatewayAPIController][Feat
7380
g.Skip(fmt.Sprintf("Skipping on non cloud platform type %q", platformType))
7481
}
7582

83+
// GatewayAPIController relies on OSSM OLM operator.
84+
// Skipping on clusters which don't have capabilities required
85+
// to install an OLM operator.
86+
exutil.SkipIfMissingCapabilities(oc, requiredCapabilities...)
87+
7688
gwapiClient := gatewayapiclientset.NewForConfigOrDie(oc.AdminConfig())
7789
// create the default gatewayClass
7890
gatewayClass := buildGatewayClass(gatewayClassName, gatewayClassControllerName)
7991
_, err = gwapiClient.GatewayV1().GatewayClasses().Create(context.TODO(), gatewayClass, metav1.CreateOptions{})
8092
if err != nil && !apierrors.IsAlreadyExists(err) {
8193
e2e.Failf("Failed to create GatewayClass %q", gatewayClassName)
8294
}
83-
8495
})
8596

8697
g.AfterAll(func() {

0 commit comments

Comments
 (0)