Skip to content

Commit 974a80c

Browse files
gcs278claude
andcommitted
Skip Gateway API tests on IPv6/dual-stack clusters
Gateway API tests fail on IPv6 and dual-stack clusters, particularly on baremetal platforms where catalog sources are typically disabled. This prevents OSSM operator installation via OLM. Replace AWS-specific dual-stack check with platform-agnostic detection that checks the cluster's ServiceNetwork CIDRs for IPv6 addressing. This will skip Gateway API tests on: - Baremetal/vSphere/EquinixMetal IPv6 or dual-stack clusters - AWS dual-stack clusters - Any other platform with IPv6 networking Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f2bfda2 commit 974a80c

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

test/extended/router/gatewayapicontroller.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"k8s.io/apimachinery/pkg/util/intstr"
2828
e2e "k8s.io/kubernetes/test/e2e/framework"
2929
admissionapi "k8s.io/pod-security-admission/api"
30+
utilnet "k8s.io/utils/net"
3031
"k8s.io/utils/pointer"
3132

3233
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -656,12 +657,11 @@ func checkPlatformSupportAndGetCapabilities(oc *exutil.CLI) (loadBalancerSupport
656657
// Check if DNS is managed (has public or private zones configured)
657658
managedDNS = isDNSManaged(oc)
658659

659-
if infra.Status.PlatformStatus.AWS != nil {
660-
ipFamily := infra.Status.PlatformStatus.AWS.IPFamily
661-
if ipFamily == configv1.DualStackIPv4Primary || ipFamily == configv1.DualStackIPv6Primary {
662-
g.Skip("Skipping Gateway API tests on dual-stack cluster")
663-
}
660+
// Skip Gateway API tests on IPv6 or dual-stack clusters (any platform)
661+
if isIPv6OrDualStack(oc) {
662+
g.Skip("Skipping Gateway API tests on IPv6/dual-stack cluster")
664663
}
664+
665665
e2e.Logf("Platform: %s, LoadBalancer supported: %t, DNS managed: %t", platformType, loadBalancerSupported, managedDNS)
666666
return loadBalancerSupported, managedDNS
667667
}
@@ -674,6 +674,20 @@ func isDNSManaged(oc *exutil.CLI) bool {
674674
return dnsConfig.Spec.PrivateZone != nil || dnsConfig.Spec.PublicZone != nil
675675
}
676676

677+
// isIPv6OrDualStack checks if the cluster is using IPv6 or dual-stack networking.
678+
// Returns true if any ServiceNetwork CIDR is IPv6 (indicates IPv6-only or dual-stack).
679+
func isIPv6OrDualStack(oc *exutil.CLI) bool {
680+
networkConfig, err := oc.AdminOperatorClient().OperatorV1().Networks().Get(context.Background(), "cluster", metav1.GetOptions{})
681+
o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get network config")
682+
683+
for _, cidr := range networkConfig.Spec.ServiceNetwork {
684+
if utilnet.IsIPv6CIDRString(cidr) {
685+
return true
686+
}
687+
}
688+
return false
689+
}
690+
677691
func isNoOLMFeatureGateEnabled(oc *exutil.CLI) bool {
678692
fgs, err := oc.AdminConfigClient().ConfigV1().FeatureGates().Get(context.TODO(), "cluster", metav1.GetOptions{})
679693
o.Expect(err).NotTo(o.HaveOccurred(), "Error getting cluster FeatureGates.")

0 commit comments

Comments
 (0)