Skip to content

Commit

Permalink
conformance: HTTPRoute resolvedRefs condition
Browse files Browse the repository at this point in the history
In the conformance tests, the ResolvedRefs condition existence is
always checked, even when true.

Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Jan 25, 2023
1 parent a36bded commit 2c5a7d8
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 32 deletions.
7 changes: 7 additions & 0 deletions conformance/tests/httproute-cross-namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -38,6 +40,11 @@ var HTTPRouteCrossNamespace = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "cross-namespace", Namespace: "gateway-conformance-web-backend"}
gwNN := types.NamespacedName{Name: "backend-namespaces", Namespace: "gateway-conformance-infra"}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

t.Run("Simple HTTP request should reach web-backend", func(t *testing.T) {
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, http.ExpectedResponse{
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-exact-path-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -39,6 +41,11 @@ var HTTPExactPathMatching = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "exact-matching", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{
{
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-header-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -39,6 +41,11 @@ var HTTPRouteHeaderMatching = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "header-matching", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{Path: "/", Headers: map[string]string{"Version": "one"}},
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-hostname-intersection.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ var HTTPRouteHostnameIntersection = suite.ConformanceTest{
{Namespace: ns, Name: "wildcard-host-matches-listener-wildcard-host"},
}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routes...)
for _, routeNN := range routes {
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})
}

var testCases []http.ExpectedResponse

Expand Down
33 changes: 23 additions & 10 deletions conformance/tests/httproute-listener-hostname-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -41,17 +43,28 @@ var HTTPRouteListenerHostnameMatching = suite.ConformanceTest{
// namespace so we have to wait for it to be ready.
kubernetes.NamespacesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, []string{ns})

routeNN1 := types.NamespacedName{Name: "backend-v1", Namespace: ns}
routeNN2 := types.NamespacedName{Name: "backend-v2", Namespace: ns}
routeNN3 := types.NamespacedName{Name: "backend-v3", Namespace: ns}
gwNN := types.NamespacedName{Name: "httproute-listener-hostname-matching", Namespace: ns}

_ = kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN, "listener-1"),
types.NamespacedName{Namespace: ns, Name: "backend-v1"},
)
_ = kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN, "listener-2"),
types.NamespacedName{Namespace: ns, Name: "backend-v2"},
)
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN, "listener-3", "listener-4"),
types.NamespacedName{Namespace: ns, Name: "backend-v3"},
)
kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN, "listener-1"), routeNN1)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN1, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})
kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN, "listener-2"), routeNN2)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN2, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN, "listener-3", "listener-4"), routeNN3)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN3, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{Host: "bar.com", Path: "/"},
Expand Down
12 changes: 12 additions & 0 deletions conformance/tests/httproute-matching-across-routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -40,6 +42,16 @@ var HTTPRouteMatchingAcrossRoutes = suite.ConformanceTest{
routeNN2 := types.NamespacedName{Name: "matching-part2", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN1, routeNN2)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN1, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN2, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -39,6 +41,11 @@ var HTTPRouteMatching = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "matching", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{Path: "/"},
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-method-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -40,6 +42,11 @@ var HTTPRouteMethodMatching = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "method-matching", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{
{
Expand Down
28 changes: 15 additions & 13 deletions conformance/tests/httproute-observed-generation-bump.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,42 @@ var HTTPRouteObservedGenerationBump = suite.ConformanceTest{
ShortName: "HTTPRouteObservedGenerationBump",
Description: "A HTTPRoute in the gateway-conformance-infra namespace should update the observedGeneration in all of it's Status.Conditions after an update to the spec",
Manifests: []string{"tests/httproute-observed-generation-bump.yaml"},
Test: func(t *testing.T, s *suite.ConformanceTestSuite) {

Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
routeNN := types.NamespacedName{Name: "observed-generation-bump", Namespace: "gateway-conformance-infra"}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: "gateway-conformance-infra"}

acceptedCondition := metav1.Condition{
Type: string(v1beta1.RouteConditionAccepted),
Status: metav1.ConditionTrue,
Reason: "", // any reason
}

t.Run("observedGeneration should increment", func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()

namespaces := []string{"gateway-conformance-infra"}
kubernetes.NamespacesMustBeAccepted(t, s.Client, s.TimeoutConfig, namespaces)
kubernetes.NamespacesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, namespaces)

original := &v1beta1.HTTPRoute{}
err := s.Client.Get(ctx, routeNN, original)
err := suite.Client.Get(ctx, routeNN, original)
require.NoErrorf(t, err, "error getting HTTPRoute: %v", err)

// Sanity check
kubernetes.HTTPRouteMustHaveLatestConditions(t, original)

mutate := original.DeepCopy()
mutate.Spec.Rules[0].BackendRefs[0].Name = "infra-backend-v2"
err = s.Client.Update(ctx, mutate)
err = suite.Client.Update(ctx, mutate)
require.NoErrorf(t, err, "error updating the HTTPRoute: %v", err)

kubernetes.HTTPRouteMustHaveCondition(t, s.Client, s.TimeoutConfig, routeNN, gwNN, acceptedCondition)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionAccepted),
Status: metav1.ConditionTrue,
Reason: "", // any reason
})
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

updated := &v1beta1.HTTPRoute{}
err = s.Client.Get(ctx, routeNN, updated)
err = suite.Client.Get(ctx, routeNN, updated)
require.NoErrorf(t, err, "error getting Gateway: %v", err)

// Sanity check
Expand Down
17 changes: 11 additions & 6 deletions conformance/tests/httproute-query-param-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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"
Expand All @@ -36,12 +38,15 @@ var HTTPRouteQueryParamMatching = suite.ConformanceTest{
Manifests: []string{"tests/httproute-query-param-matching.yaml"},
Features: []suite.SupportedFeature{suite.SupportHTTPRouteQueryParamMatching},
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
var (
ns = "gateway-conformance-infra"
routeNN = types.NamespacedName{Namespace: ns, Name: "query-param-matching"}
gwNN = types.NamespacedName{Namespace: ns, Name: "same-namespace"}
gwAddr = kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
)
ns := "gateway-conformance-infra"
routeNN := types.NamespacedName{Namespace: ns, Name: "query-param-matching"}
gwNN := types.NamespacedName{Namespace: ns, Name: "same-namespace"}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{Path: "/?animal=whale"},
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-redirect-host-and-status.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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/roundtripper"
Expand All @@ -40,6 +42,11 @@ var HTTPRouteRedirectHostAndStatus = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "redirect-host-and-status", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-redirect-path.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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/roundtripper"
Expand All @@ -41,6 +43,11 @@ var HTTPRouteRedirectPath = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "redirect-path", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-redirect-port.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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/roundtripper"
Expand All @@ -41,6 +43,11 @@ var HTTPRouteRedirectPort = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "redirect-port", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{
Expand Down
7 changes: 7 additions & 0 deletions conformance/tests/httproute-redirect-scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package tests
import (
"testing"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"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/roundtripper"
Expand All @@ -41,6 +43,11 @@ var HTTPRouteRedirectScheme = suite.ConformanceTest{
routeNN := types.NamespacedName{Name: "redirect-scheme", Namespace: ns}
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
kubernetes.HTTPRouteMustHaveCondition(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN, metav1.Condition{
Type: string(v1beta1.RouteConditionResolvedRefs),
Status: metav1.ConditionTrue,
Reason: string(v1beta1.RouteReasonResolvedRefs),
})

testCases := []http.ExpectedResponse{{
Request: http.Request{
Expand Down
Loading

0 comments on commit 2c5a7d8

Please sign in to comment.