From 4c94ab002ad88ccf2a419e0263e2dba24d718288 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Wed, 10 May 2023 14:48:57 -0700 Subject: [PATCH 1/8] Bump to gateway api v0.7.0-rc2 * Release notes https://github.com/kubernetes-sigs/gateway-api/releases/tag/v0.7.0-rc2 * Also re enable redirect tests because of the fixes made in those tests should make the tests API conformant :) Signed-off-by: Arko Dasgupta --- go.mod | 2 +- go.sum | 4 ++-- test/conformance/conformance_test.go | 8 -------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 6f479e3a4c4..071c3a96464 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( k8s.io/kubectl v0.27.2 k8s.io/utils v0.0.0-20230209194617-a36077c30491 sigs.k8s.io/controller-runtime v0.15.0-beta.0 - sigs.k8s.io/gateway-api v0.7.0-rc1 + sigs.k8s.io/gateway-api v0.7.0 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index 08119710b38..89d38892652 100644 --- a/go.sum +++ b/go.sum @@ -653,8 +653,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/controller-runtime v0.15.0-beta.0 h1:pkhYMops8jZrVuI0kBHeF6q9UVu1JljIGGG4Ox5ZJmk= sigs.k8s.io/controller-runtime v0.15.0-beta.0/go.mod h1:YUTa+du31rqOu4mJaijiuhGFax9ecCJgO/v0/yW09gE= -sigs.k8s.io/gateway-api v0.7.0-rc1 h1:dVUmLp5W4QBv9diU99ULf9n5v/incEmdVU98rkSa+7Y= -sigs.k8s.io/gateway-api v0.7.0-rc1/go.mod h1:Xv0+ZMxX0lu1nSSDIIPEfbVztgNZ+3cfiYrJsa2Ooso= +sigs.k8s.io/gateway-api v0.7.0 h1:/mG8yyJNBifqvuVLW5gwlI4CQs0NR/5q4BKUlf1bVdY= +sigs.k8s.io/gateway-api v0.7.0/go.mod h1:Xv0+ZMxX0lu1nSSDIIPEfbVztgNZ+3cfiYrJsa2Ooso= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.13.2 h1:kejWfLeJhUsTGioDoFNJET5LQe/ajzXhJGYoU+pJsiA= diff --git a/test/conformance/conformance_test.go b/test/conformance/conformance_test.go index e0e2b0ab340..85de22d4d41 100644 --- a/test/conformance/conformance_test.go +++ b/test/conformance/conformance_test.go @@ -55,14 +55,6 @@ func TestGatewayAPIConformance(t *testing.T) { ValidUniqueListenerPorts: validUniqueListenerPorts, SupportedFeatures: suite.AllFeatures, ExemptFeatures: suite.MeshCoreFeatures, - SkipTests: []string{ - // Remove once https://github.com/envoyproxy/gateway/issues/993 is fixed - tests.HTTPRouteRedirectPath.ShortName, - // Remove once https://github.com/envoyproxy/gateway/issues/992 is fixed - tests.HTTPRouteRedirectHostAndStatus.ShortName, - // Remove once https://github.com/envoyproxy/gateway/issues/994 is fixed - tests.HTTPRouteRedirectScheme.ShortName, - }, }) cSuite.Setup(t) cSuite.Run(t, tests.ConformanceTests) From 12c010eb54121af7e62a81138c3efe47702b8291 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Wed, 10 May 2023 15:02:57 -0700 Subject: [PATCH 2/8] make manifests Signed-off-by: Arko Dasgupta --- charts/gateway-helm/crds/gatewayapi-crds.yaml | 124 ++++++++++++------ 1 file changed, 85 insertions(+), 39 deletions(-) diff --git a/charts/gateway-helm/crds/gatewayapi-crds.yaml b/charts/gateway-helm/crds/gatewayapi-crds.yaml index 3e8507a5bcd..7dad4cbb86c 100644 --- a/charts/gateway-helm/crds/gatewayapi-crds.yaml +++ b/charts/gateway-helm/crds/gatewayapi-crds.yaml @@ -24,7 +24,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: gatewayclasses.gateway.networking.k8s.io @@ -459,7 +459,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: gateways.gateway.networking.k8s.io @@ -1898,7 +1898,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: grpcroutes.gateway.networking.k8s.io @@ -3399,7 +3399,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: httproutes.gateway.networking.k8s.io @@ -3976,8 +3976,17 @@ spec: port: description: "Port is the port to be used in the value of the `Location` header in the - response. \n When empty, the Gateway Listener - port is used. \n Implementations SHOULD NOT + response. \n If no port is specified, the + redirect port MUST be derived using the following + rules: \n * If redirect scheme is not-empty, + the redirect port MUST be the well-known port + associated with the redirect scheme. Specifically + \"http\" to port 80 and \"https\" to port + 443. If the redirect scheme does not have + a well-known port, the listener port of the + Gateway SHOULD be used. * If redirect scheme + is empty, the redirect port MUST be the Gateway + Listener port. \n Implementations SHOULD NOT add the port number in the 'Location' header in the following cases: \n * A Location header that will use HTTP (whether that is determined @@ -3994,8 +4003,11 @@ spec: description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request - is used. \n Note that values may be added - to this enum, implementations must ensure + is used. \n Scheme redirects can affect the + port of the redirect, for more information, + refer to the documentation for the port field + of this filter. \n Note that values may be + added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition @@ -4617,16 +4629,24 @@ spec: type: object port: description: "Port is the port to be used in the value - of the `Location` header in the response. \n When - empty, the Gateway Listener port is used. \n Implementations - SHOULD NOT add the port number in the 'Location' - header in the following cases: \n * A Location header - that will use HTTP (whether that is determined via - the Listener protocol or the Scheme field) _and_ - use port 80. * A Location header that will use HTTPS - (whether that is determined via the Listener protocol - or the Scheme field) _and_ use port 443. \n Support: - Extended" + of the `Location` header in the response. \n If + no port is specified, the redirect port MUST be + derived using the following rules: \n * If redirect + scheme is not-empty, the redirect port MUST be the + well-known port associated with the redirect scheme. + Specifically \"http\" to port 80 and \"https\" to + port 443. If the redirect scheme does not have a + well-known port, the listener port of the Gateway + SHOULD be used. * If redirect scheme is empty, the + redirect port MUST be the Gateway Listener port. + \n Implementations SHOULD NOT add the port number + in the 'Location' header in the following cases: + \n * A Location header that will use HTTP (whether + that is determined via the Listener protocol or + the Scheme field) _and_ use port 80. * A Location + header that will use HTTPS (whether that is determined + via the Listener protocol or the Scheme field) _and_ + use port 443. \n Support: Extended" format: int32 maximum: 65535 minimum: 1 @@ -4635,7 +4655,10 @@ spec: description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used. \n - Note that values may be added to this enum, implementations + Scheme redirects can affect the port of the redirect, + for more information, refer to the documentation + for the port field of this filter. \n Note that + values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for @@ -5871,8 +5894,17 @@ spec: port: description: "Port is the port to be used in the value of the `Location` header in the - response. \n When empty, the Gateway Listener - port is used. \n Implementations SHOULD NOT + response. \n If no port is specified, the + redirect port MUST be derived using the following + rules: \n * If redirect scheme is not-empty, + the redirect port MUST be the well-known port + associated with the redirect scheme. Specifically + \"http\" to port 80 and \"https\" to port + 443. If the redirect scheme does not have + a well-known port, the listener port of the + Gateway SHOULD be used. * If redirect scheme + is empty, the redirect port MUST be the Gateway + Listener port. \n Implementations SHOULD NOT add the port number in the 'Location' header in the following cases: \n * A Location header that will use HTTP (whether that is determined @@ -5889,8 +5921,11 @@ spec: description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request - is used. \n Note that values may be added - to this enum, implementations must ensure + is used. \n Scheme redirects can affect the + port of the redirect, for more information, + refer to the documentation for the port field + of this filter. \n Note that values may be + added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition @@ -6512,16 +6547,24 @@ spec: type: object port: description: "Port is the port to be used in the value - of the `Location` header in the response. \n When - empty, the Gateway Listener port is used. \n Implementations - SHOULD NOT add the port number in the 'Location' - header in the following cases: \n * A Location header - that will use HTTP (whether that is determined via - the Listener protocol or the Scheme field) _and_ - use port 80. * A Location header that will use HTTPS - (whether that is determined via the Listener protocol - or the Scheme field) _and_ use port 443. \n Support: - Extended" + of the `Location` header in the response. \n If + no port is specified, the redirect port MUST be + derived using the following rules: \n * If redirect + scheme is not-empty, the redirect port MUST be the + well-known port associated with the redirect scheme. + Specifically \"http\" to port 80 and \"https\" to + port 443. If the redirect scheme does not have a + well-known port, the listener port of the Gateway + SHOULD be used. * If redirect scheme is empty, the + redirect port MUST be the Gateway Listener port. + \n Implementations SHOULD NOT add the port number + in the 'Location' header in the following cases: + \n * A Location header that will use HTTP (whether + that is determined via the Listener protocol or + the Scheme field) _and_ use port 80. * A Location + header that will use HTTPS (whether that is determined + via the Listener protocol or the Scheme field) _and_ + use port 443. \n Support: Extended" format: int32 maximum: 65535 minimum: 1 @@ -6530,7 +6573,10 @@ spec: description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used. \n - Note that values may be added to this enum, implementations + Scheme redirects can affect the port of the redirect, + for more information, refer to the documentation + for the port field of this filter. \n Note that + values may be added to this enum, implementations must ensure that unknown values will not cause a crash. \n Unknown values here must result in the implementation setting the Accepted Condition for @@ -7222,7 +7268,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: referencegrants.gateway.networking.k8s.io @@ -7504,7 +7550,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: tcproutes.gateway.networking.k8s.io @@ -8034,7 +8080,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: tlsroutes.gateway.networking.k8s.io @@ -8613,7 +8659,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc1 + gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: udproutes.gateway.networking.k8s.io @@ -9204,7 +9250,7 @@ spec: spec: containers: - name: webhook - image: registry.k8s.io/gateway-api/admission-server:v0.7.0-rc1 + image: registry.k8s.io/gateway-api/admission-server:v0.7.0-rc2 imagePullPolicy: Always args: - -logtostderr From 88659b860fdf2395a660f322b36beffbf8218c8b Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Thu, 11 May 2023 22:57:13 -0700 Subject: [PATCH 3/8] rm ValidUniqueListenerPorts Signed-off-by: Arko Dasgupta --- .github/workflows/build_and_test.yaml | 2 -- test/conformance/conformance_test.go | 26 ++++++-------------------- tools/make/kube.mk | 4 +--- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index ff5102d2100..c98d69a2684 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -93,7 +93,6 @@ jobs: - name: Run Conformance Tests env: KIND_NODE_TAG: ${{ matrix.version }} - CONFORMANCE_UNIQUE_PORTS: false IMAGE_PULL_POLICY: IfNotPresent run: make conformance @@ -122,7 +121,6 @@ jobs: - name: Run E2E Tests env: KIND_NODE_TAG: ${{ matrix.version }} - CONFORMANCE_UNIQUE_PORTS: false IMAGE_PULL_POLICY: IfNotPresent run: make e2e diff --git a/test/conformance/conformance_test.go b/test/conformance/conformance_test.go index 85de22d4d41..a913b6ccd57 100644 --- a/test/conformance/conformance_test.go +++ b/test/conformance/conformance_test.go @@ -22,8 +22,6 @@ import ( "sigs.k8s.io/gateway-api/conformance/utils/suite" ) -var useUniquePorts = flag.Bool("use-unique-ports", true, "whether to use unique ports") - func TestGatewayAPIConformance(t *testing.T) { flag.Parse() @@ -36,25 +34,13 @@ func TestGatewayAPIConformance(t *testing.T) { require.NoError(t, v1alpha2.AddToScheme(client.Scheme())) require.NoError(t, v1beta1.AddToScheme(client.Scheme())) - validUniqueListenerPorts := []v1alpha2.PortNumber{ - v1alpha2.PortNumber(int32(80)), - v1alpha2.PortNumber(int32(81)), - v1alpha2.PortNumber(int32(82)), - v1alpha2.PortNumber(int32(83)), - } - - if !*useUniquePorts { - validUniqueListenerPorts = []v1alpha2.PortNumber{} - } - cSuite := suite.New(suite.Options{ - Client: client, - GatewayClassName: *flags.GatewayClassName, - Debug: *flags.ShowDebug, - CleanupBaseResources: *flags.CleanupBaseResources, - ValidUniqueListenerPorts: validUniqueListenerPorts, - SupportedFeatures: suite.AllFeatures, - ExemptFeatures: suite.MeshCoreFeatures, + Client: client, + GatewayClassName: *flags.GatewayClassName, + Debug: *flags.ShowDebug, + CleanupBaseResources: *flags.CleanupBaseResources, + SupportedFeatures: suite.AllFeatures, + ExemptFeatures: suite.MeshCoreFeatures, }) cSuite.Setup(t) cSuite.Run(t, tests.ConformanceTests) diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 9a13f2930da..ce86a92b29b 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -6,8 +6,6 @@ GATEWAY_API_VERSION ?= $(shell go list -m -f '{{.Version}}' sigs.k8s.io/gateway- GATEWAY_RELEASE_URL ?= https://github.com/kubernetes-sigs/gateway-api/releases/download/${GATEWAY_API_VERSION}/experimental-install.yaml -CONFORMANCE_UNIQUE_PORTS ?= true - WAIT_TIMEOUT ?= 15m # Set Kubernetes Resources Directory Path @@ -132,7 +130,7 @@ run-conformance: ## Run Gateway API conformance. kubectl wait --timeout=$(WAIT_TIMEOUT) -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available kubectl wait --timeout=$(WAIT_TIMEOUT) -n gateway-system job/gateway-api-admission --for=condition=Complete kubectl apply -f test/config/gatewayclass.yaml - go test -v -tags conformance ./test/conformance --gateway-class=envoy-gateway --debug=true --use-unique-ports=$(CONFORMANCE_UNIQUE_PORTS) + go test -v -tags conformance ./test/conformance --gateway-class=envoy-gateway --debug=true .PHONY: delete-cluster delete-cluster: $(tools/kind) ## Delete kind cluster. From 094fc86ac550272a9a4b4eb8e4cba4d2ac4170fc Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Thu, 11 May 2023 23:54:32 -0700 Subject: [PATCH 4/8] set default port Signed-off-by: Arko Dasgupta --- internal/gatewayapi/route.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 859ad2a0297..034d9bd73cf 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -525,6 +525,13 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route } for _, routeRoute := range routeRoutes { + // Set redirect port to listener port when redirect port and scheme is + // unspecified + if routeRoute.Redirect.Port == nil && routeRoute.Redirect.Scheme == nil { + port := uint32(listener.Port) + routeRoute.Redirect.Port = &port + } + hostRoute := &ir.HTTPRoute{ Name: fmt.Sprintf("%s-%s", routeRoute.Name, host), PathMatch: routeRoute.PathMatch, From 3b2f21216681272961fd55b8078a060c5b62e213 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Tue, 23 May 2023 16:51:20 -0700 Subject: [PATCH 5/8] bump to v0.7.0 Signed-off-by: Arko Dasgupta --- charts/gateway-helm/crds/gatewayapi-crds.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/gateway-helm/crds/gatewayapi-crds.yaml b/charts/gateway-helm/crds/gatewayapi-crds.yaml index 7dad4cbb86c..478c46ff96e 100644 --- a/charts/gateway-helm/crds/gatewayapi-crds.yaml +++ b/charts/gateway-helm/crds/gatewayapi-crds.yaml @@ -24,7 +24,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: gatewayclasses.gateway.networking.k8s.io @@ -459,7 +459,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: gateways.gateway.networking.k8s.io @@ -1898,7 +1898,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: grpcroutes.gateway.networking.k8s.io @@ -3399,7 +3399,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: httproutes.gateway.networking.k8s.io @@ -7268,7 +7268,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: referencegrants.gateway.networking.k8s.io @@ -7550,7 +7550,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: tcproutes.gateway.networking.k8s.io @@ -8080,7 +8080,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: tlsroutes.gateway.networking.k8s.io @@ -8659,7 +8659,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/1923 - gateway.networking.k8s.io/bundle-version: v0.7.0-rc2 + gateway.networking.k8s.io/bundle-version: v0.7.0 gateway.networking.k8s.io/channel: experimental creationTimestamp: null name: udproutes.gateway.networking.k8s.io @@ -9250,7 +9250,7 @@ spec: spec: containers: - name: webhook - image: registry.k8s.io/gateway-api/admission-server:v0.7.0-rc2 + image: registry.k8s.io/gateway-api/admission-server:v0.7.0 imagePullPolicy: Always args: - -logtostderr From 477bd55250aa8c7fa076a6985b711c4a7321f8a7 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Tue, 23 May 2023 17:05:30 -0700 Subject: [PATCH 6/8] fix panic Signed-off-by: Arko Dasgupta --- internal/gatewayapi/route.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 034d9bd73cf..14b3e5164a2 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -527,7 +527,9 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route for _, routeRoute := range routeRoutes { // Set redirect port to listener port when redirect port and scheme is // unspecified - if routeRoute.Redirect.Port == nil && routeRoute.Redirect.Scheme == nil { + if routeRoute.Redirect != nil && + routeRoute.Redirect.Port == nil && + routeRoute.Redirect.Scheme == nil { port := uint32(listener.Port) routeRoute.Redirect.Port = &port } From cd19897a7c87e2bc9ea8ae2a2a3d8d78ba269890 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Tue, 23 May 2023 17:36:31 -0700 Subject: [PATCH 7/8] revert Signed-off-by: Arko Dasgupta --- internal/gatewayapi/route.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 14b3e5164a2..3fafe81fe8e 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -527,13 +527,14 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route for _, routeRoute := range routeRoutes { // Set redirect port to listener port when redirect port and scheme is // unspecified - if routeRoute.Redirect != nil && - routeRoute.Redirect.Port == nil && - routeRoute.Redirect.Scheme == nil { - port := uint32(listener.Port) - routeRoute.Redirect.Port = &port - } - + /* + if routeRoute.Redirect != nil && + routeRoute.Redirect.Port == nil && + routeRoute.Redirect.Scheme == nil { + port := uint32(listener.Port) + routeRoute.Redirect.Port = &port + } + */ hostRoute := &ir.HTTPRoute{ Name: fmt.Sprintf("%s-%s", routeRoute.Name, host), PathMatch: routeRoute.PathMatch, From 33159b5ced5ce4fe0097f6ac0690e9e3be2268ce Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Tue, 23 May 2023 18:11:50 -0700 Subject: [PATCH 8/8] disable HTTPRouteRedirectPortAndScheme Signed-off-by: Arko Dasgupta --- internal/gatewayapi/route.go | 10 ---------- test/conformance/conformance_test.go | 3 +++ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 3fafe81fe8e..859ad2a0297 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -525,16 +525,6 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route } for _, routeRoute := range routeRoutes { - // Set redirect port to listener port when redirect port and scheme is - // unspecified - /* - if routeRoute.Redirect != nil && - routeRoute.Redirect.Port == nil && - routeRoute.Redirect.Scheme == nil { - port := uint32(listener.Port) - routeRoute.Redirect.Port = &port - } - */ hostRoute := &ir.HTTPRoute{ Name: fmt.Sprintf("%s-%s", routeRoute.Name, host), PathMatch: routeRoute.PathMatch, diff --git a/test/conformance/conformance_test.go b/test/conformance/conformance_test.go index a913b6ccd57..22b1f143c0b 100644 --- a/test/conformance/conformance_test.go +++ b/test/conformance/conformance_test.go @@ -41,6 +41,9 @@ func TestGatewayAPIConformance(t *testing.T) { CleanupBaseResources: *flags.CleanupBaseResources, SupportedFeatures: suite.AllFeatures, ExemptFeatures: suite.MeshCoreFeatures, + SkipTests: []string{ + tests.HTTPRouteRedirectPortAndScheme.ShortName, + }, }) cSuite.Setup(t) cSuite.Run(t, tests.ConformanceTests)