Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: httproute-with-dynamic-resolver-backend-tls-system-trust-store
namespace: gateway-conformance-infra
spec:
parentRefs:
- name: same-namespace
rules:
- backendRefs:
- group: gateway.envoyproxy.io
kind: Backend
name: backend-dynamic-resolver-tls-system-trust-store
matches:
- path:
type: PathPrefix
value: /with-tls-system-trust-store
filters:
- type: URLRewrite # rewrite the path to /, as we use gateway.envoyproxy.io to test the dynamic resolver, and this path is not available
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: Backend
metadata:
name: backend-dynamic-resolver-tls-system-trust-store
namespace: gateway-conformance-infra
spec:
type: DynamicResolver
tls:
wellKnownCACertificates: System
22 changes: 22 additions & 0 deletions test/e2e/tests/httproute_with_dynamic_resolver_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var DynamicResolverBackendTest = suite.ConformanceTest{
Manifests: []string{
"testdata/httproute-with-dynamic-resolver-backend.yaml",
"testdata/httproute-with-dynamic-resolver-backend-with-tls.yaml",
"testdata/httproute-with-dynamic-resolver-backend-with-tls-system-ca.yaml",
},
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
ns := "gateway-conformance-infra"
Expand Down Expand Up @@ -80,5 +81,26 @@ var DynamicResolverBackendTest = suite.ConformanceTest{

http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse)
})
t.Run("route to service with TLS using system CA", func(t *testing.T) {
routeNN := types.NamespacedName{Name: "httproute-with-dynamic-resolver-backend-tls-system-trust-store", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
BackendMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "backend-dynamic-resolver-tls-system-trust-store", Namespace: ns})

expectedResponse := http.ExpectedResponse{
Request: http.Request{
Host: "gateway.envoyproxy.io:443",
Path: "/with-tls-system-trust-store",
},
ExpectedRequest: &http.ExpectedRequest{
Request: http.Request{
Host: "",
},
},
Response: http.Response{
StatusCode: 200,
},
}
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse)
})
},
}
Loading