1
0
Fork 0

Fix HTTPRoute Redirect Filter with port and scheme

Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
Romain 2024-06-06 10:56:03 +02:00 committed by GitHub
parent 7eac92f49c
commit 28d40e7f3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 431 additions and 93 deletions

View file

@ -48,6 +48,8 @@ spec:
- --api.insecure
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --entrypoints.web8080.address=:8080
- --entrypoints.traefik.address=:9000
- --experimental.kubernetesgateway
- --providers.kubernetesgateway.experimentalChannel
- --providers.kubernetesgateway.statusaddress.service.namespace=traefik
@ -55,10 +57,12 @@ spec:
ports:
- name: web
containerPort: 80
- name: admin
containerPort: 8080
- name: websecure
containerPort: 443
- name: web8080
containerPort: 8080
- name: traefik
containerPort: 9000
---
apiVersion: v1
@ -78,5 +82,8 @@ spec:
name: websecure
targetPort: websecure
- port: 8080
name: admin
targetPort: admin
name: web8080
targetPort: web8080
- port: 9000
name: traefik
targetPort: traefik

View file

@ -166,7 +166,7 @@ func (s *K8sConformanceSuite) TestK8sGatewayAPIConformance() {
k3sContainerIP, err := s.k3sContainer.ContainerIP(context.Background())
require.NoError(s.T(), err)
err = try.GetRequest("http://"+k3sContainerIP+":8080/api/entrypoints", 10*time.Second, try.BodyContains(`"name":"web"`))
err = try.GetRequest("http://"+k3sContainerIP+":9000/api/entrypoints", 10*time.Second, try.BodyContains(`"name":"web"`))
require.NoError(s.T(), err)
opts := ksuite.Options{
@ -195,23 +195,32 @@ func (s *K8sConformanceSuite) TestK8sGatewayAPIConformance() {
LatestObservedGenerationSet: 5 * time.Second,
RequiredConsecutiveSuccesses: 0,
},
SupportedFeatures: sets.New(ksuite.SupportGateway, ksuite.SupportHTTPRoute).
Union(ksuite.HTTPRouteExtendedFeatures),
SupportedFeatures: sets.New(ksuite.SupportGateway,
ksuite.SupportGatewayPort8080,
ksuite.SupportHTTPRoute,
ksuite.SupportHTTPRouteQueryParamMatching,
ksuite.SupportHTTPRouteMethodMatching,
ksuite.SupportHTTPRoutePortRedirect,
ksuite.SupportHTTPRouteSchemeRedirect,
ksuite.SupportHTTPRouteHostRewrite,
ksuite.SupportHTTPRoutePathRewrite,
),
ExemptFeatures: sets.New(
ksuite.SupportHTTPRouteRequestTimeout,
ksuite.SupportHTTPRouteBackendTimeout,
ksuite.SupportHTTPRouteResponseHeaderModification,
ksuite.SupportHTTPRoutePathRedirect,
ksuite.SupportHTTPRouteRequestMirror,
ksuite.SupportHTTPRouteRequestMultipleMirrors,
),
EnableAllSupportedFeatures: false,
RunTest: *k8sConformanceRunTest,
// Until the feature are all supported, following tests are skipped.
SkipTests: []string{
tests.HTTPRouteMethodMatching.ShortName,
tests.HTTPRouteQueryParamMatching.ShortName,
tests.HTTPRouteRedirectPath.ShortName,
tests.HTTPRouteRedirectPortAndScheme.ShortName,
tests.HTTPRouteRequestMirror.ShortName,
tests.HTTPRouteRequestMultipleMirrors.ShortName,
tests.HTTPRouteResponseHeaderModifier.ShortName,
tests.HTTPRouteRewriteHost.ShortName,
tests.HTTPRouteRewritePath.ShortName,
tests.HTTPRouteTimeoutBackendRequest.ShortName,
tests.HTTPRouteTimeoutRequest.ShortName,
},
}