From cd370d5b9cbf940328ece574fe616f9938f60a5c Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Fri, 26 May 2023 10:54:09 -0600 Subject: [PATCH] conformance: wait for namespace to be ready in TLSRoute test Since this test creates a new Gateway, wait for the namespace/contained pods to be ready before proceeding. Signed-off-by: Steve Kriss --- conformance/tests/tlsroute-simple-same-namespace.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/conformance/tests/tlsroute-simple-same-namespace.go b/conformance/tests/tlsroute-simple-same-namespace.go index 3535b8a1f7..87481d13d9 100644 --- a/conformance/tests/tlsroute-simple-same-namespace.go +++ b/conformance/tests/tlsroute-simple-same-namespace.go @@ -27,7 +27,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/http" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" "sigs.k8s.io/gateway-api/conformance/utils/suite" @@ -47,10 +46,12 @@ var TLSRouteSimpleSameNamespace = suite.ConformanceTest{ }, Manifests: []string{"tests/tlsroute-simple-same-namespace.yaml"}, Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { - ns := v1beta1.Namespace("gateway-conformance-infra") - routeNN := types.NamespacedName{Name: "gateway-conformance-infra-test", Namespace: string(ns)} - gwNN := types.NamespacedName{Name: "gateway-tlsroute", Namespace: string(ns)} - certNN := types.NamespacedName{Name: "tls-passthrough-checks-certificate", Namespace: string(ns)} + ns := "gateway-conformance-infra" + routeNN := types.NamespacedName{Name: "gateway-conformance-infra-test", Namespace: ns} + gwNN := types.NamespacedName{Name: "gateway-tlsroute", Namespace: ns} + certNN := types.NamespacedName{Name: "tls-passthrough-checks-certificate", Namespace: ns} + + kubernetes.NamespacesMustBeReady(t, suite.Client, suite.TimeoutConfig, []string{ns}) gwAddr, hostnames := kubernetes.GatewayAndTLSRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN) if len(hostnames) != 1 {