generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 566
Move HTTPRouteRule and GRPCRouteRule 'name' fields to Standard #3826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
k8s-ci-robot
merged 9 commits into
kubernetes-sigs:main
from
guicassolato:gep/995-standard
Jul 3, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4161a80
Promote HTTPRouteRule and GRPCRouteRule 'name' fields to Standard
guicassolato 3fb3361
tests: conformance: httproute and grpcroute named rules
guicassolato f6e0b4f
tests: mesh conformance tests for httproute
guicassolato f4f2107
feature names: HTTPRouteNamedRouteRule and GRPCRouteNamedRouteRule
guicassolato f80b94d
fix: mesh conformance features and object name/namespace
guicassolato cda8916
lint: fix var declaration and comment
guicassolato 18bb1f8
different name for HTTPRouteRuleNamedRouteRule feature for mesh
guicassolato d4b592a
conformance tests flagged as provisional
guicassolato 9f14021
fix: typo
guicassolato File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
config/crd/standard/gateway.networking.k8s.io_grpcroutes.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
config/crd/standard/gateway.networking.k8s.io_httproutes.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
Copyright 2025 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"k8s.io/apimachinery/pkg/types" | ||
|
||
v1 "sigs.k8s.io/gateway-api/apis/v1" | ||
pb "sigs.k8s.io/gateway-api/conformance/echo-basic/grpcechoserver" | ||
"sigs.k8s.io/gateway-api/conformance/utils/grpc" | ||
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes" | ||
"sigs.k8s.io/gateway-api/conformance/utils/suite" | ||
"sigs.k8s.io/gateway-api/pkg/features" | ||
) | ||
|
||
func init() { | ||
ConformanceTests = append(ConformanceTests, GRPCRouteNamedRule) | ||
} | ||
|
||
var GRPCRouteNamedRule = suite.ConformanceTest{ | ||
ShortName: "GRPCRouteNamedRule", | ||
Description: "An GRPCRoute with a named GRPCRouteRule", | ||
Manifests: []string{"tests/grpcroute-named-rule.yaml"}, | ||
Features: []features.FeatureName{ | ||
features.SupportGateway, | ||
features.SupportGRPCRoute, | ||
features.SupportGRPCRouteNamedRouteRule, | ||
}, | ||
guicassolato marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Provisional: true, | ||
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { | ||
ns := "gateway-conformance-infra" | ||
routeNN := types.NamespacedName{Name: "grpc-named-rules", Namespace: ns} | ||
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns} | ||
gwAddr := kubernetes.GatewayAndRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), &v1.GRPCRoute{}, routeNN) | ||
|
||
testCases := []grpc.ExpectedResponse{ | ||
{ | ||
EchoRequest: &pb.EchoRequest{}, | ||
Backend: "grpc-infra-backend-v1", | ||
Namespace: ns, | ||
}, { | ||
EchoTwoRequest: &pb.EchoRequest{}, | ||
Backend: "grpc-infra-backend-v2", | ||
Namespace: ns, | ||
}, | ||
} | ||
|
||
for i := range testCases { | ||
tc := testCases[i] | ||
t.Run(tc.GetTestCaseName(i), func(t *testing.T) { | ||
t.Parallel() | ||
grpc.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.GRPCClient, suite.TimeoutConfig, gwAddr, tc) | ||
}) | ||
} | ||
}, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: GRPCRoute | ||
metadata: | ||
name: grpc-named-rules | ||
namespace: gateway-conformance-infra | ||
spec: | ||
parentRefs: | ||
- name: same-namespace | ||
rules: | ||
- name: named-rule | ||
matches: | ||
- method: | ||
service: gateway_api_conformance.echo_basic.grpcecho.GrpcEcho | ||
method: Echo | ||
backendRefs: | ||
- name: grpc-infra-backend-v1 | ||
port: 8080 | ||
- matches: | ||
- method: | ||
service: gateway_api_conformance.echo_basic.grpcecho.GrpcEcho | ||
method: EchoTwo | ||
backendRefs: | ||
- name: grpc-infra-backend-v2 | ||
port: 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
Copyright 2025 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"k8s.io/apimachinery/pkg/types" | ||
|
||
"sigs.k8s.io/gateway-api/conformance/utils/http" | ||
"sigs.k8s.io/gateway-api/conformance/utils/kubernetes" | ||
"sigs.k8s.io/gateway-api/conformance/utils/suite" | ||
"sigs.k8s.io/gateway-api/pkg/features" | ||
) | ||
|
||
func init() { | ||
ConformanceTests = append(ConformanceTests, HTTPRouteNamedRule) | ||
} | ||
|
||
var HTTPRouteNamedRule = suite.ConformanceTest{ | ||
ShortName: "HTTPRouteNamedRule", | ||
Description: "An HTTPRoute with a named HTTPRouteRule", | ||
Manifests: []string{"tests/httproute-named-rule.yaml"}, | ||
Features: []features.FeatureName{ | ||
features.SupportGateway, | ||
features.SupportHTTPRoute, | ||
shaneutt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
features.SupportHTTPRouteNamedRouteRule, | ||
}, | ||
guicassolato marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Provisional: true, | ||
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { | ||
ns := "gateway-conformance-infra" | ||
routeNN := types.NamespacedName{Name: "http-named-rules", 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.HTTPRouteMustHaveResolvedRefsConditionsTrue(t, suite.Client, suite.TimeoutConfig, routeNN, gwNN) | ||
|
||
testCases := []http.ExpectedResponse{ | ||
{ | ||
Request: http.Request{Path: "/named"}, | ||
Response: http.Response{StatusCode: 200}, | ||
Namespace: ns, | ||
}, { | ||
Request: http.Request{Path: "/unnamed"}, | ||
Response: http.Response{StatusCode: 200}, | ||
Namespace: ns, | ||
}, | ||
} | ||
|
||
for i := range testCases { | ||
tc := testCases[i] | ||
t.Run(tc.GetTestCaseName(i), func(t *testing.T) { | ||
t.Parallel() | ||
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, tc) | ||
}) | ||
} | ||
}, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: http-named-rules | ||
namespace: gateway-conformance-infra | ||
spec: | ||
parentRefs: | ||
- name: same-namespace | ||
rules: | ||
- name: named-rule | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /named | ||
backendRefs: | ||
- name: infra-backend-v1 | ||
port: 8080 | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /unnamed | ||
backendRefs: | ||
- name: infra-backend-v2 | ||
port: 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
Copyright 2025 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package meshtests | ||
|
||
import ( | ||
"testing" | ||
|
||
"sigs.k8s.io/gateway-api/conformance/utils/echo" | ||
"sigs.k8s.io/gateway-api/conformance/utils/http" | ||
"sigs.k8s.io/gateway-api/conformance/utils/suite" | ||
"sigs.k8s.io/gateway-api/pkg/features" | ||
) | ||
|
||
func init() { | ||
MeshConformanceTests = append(MeshConformanceTests, MeshHTTPRouteNamedRule) | ||
} | ||
|
||
var MeshHTTPRouteNamedRule = suite.ConformanceTest{ | ||
ShortName: "MeshHTTPRouteNamedRule", | ||
Description: "An HTTPRoute with a named HTTPRouteRule", | ||
Manifests: []string{"tests/mesh/httproute-named-rule.yaml"}, | ||
Features: []features.FeatureName{ | ||
features.SupportMesh, | ||
features.SupportHTTPRoute, | ||
features.SupportMeshHTTPRouteNamedRouteRule, | ||
}, | ||
Provisional: true, | ||
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { | ||
guicassolato marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ns := "gateway-conformance-mesh" | ||
client := echo.ConnectToApp(t, suite, echo.MeshAppEchoV1) | ||
|
||
testCases := []http.ExpectedResponse{ | ||
{ | ||
Request: http.Request{Path: "/named"}, | ||
ExpectedRequest: &http.ExpectedRequest{Request: http.Request{Path: "/named"}}, | ||
Backend: "echo-v1", | ||
Namespace: ns, | ||
}, { | ||
Request: http.Request{Path: "/unnamed"}, | ||
ExpectedRequest: &http.ExpectedRequest{Request: http.Request{Path: "/named"}}, | ||
Backend: "echo-v2", | ||
Namespace: ns, | ||
}, | ||
} | ||
|
||
for i := range testCases { | ||
tc := testCases[i] | ||
t.Run(tc.GetTestCaseName(i), func(t *testing.T) { | ||
t.Parallel() | ||
client.MakeRequestAndExpectEventuallyConsistentResponse(t, tc, suite.TimeoutConfig) | ||
}) | ||
} | ||
}, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: mesh-http-named-rules | ||
namespace: gateway-conformance-mesh | ||
spec: | ||
parentRefs: | ||
- group: "" | ||
kind: Service | ||
name: echo | ||
port: 80 | ||
rules: | ||
- name: named-rule | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /named | ||
backendRefs: | ||
- name: echo-v1 | ||
port: 8080 | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /unnamed | ||
backendRefs: | ||
- name: echo-v2 | ||
port: 8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.