Skip to content

Commit 8fcde39

Browse files
committed
address comments
1 parent d325715 commit 8fcde39

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

apis/v1/grpcroute_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ type GRPCRouteRule struct {
156156
//
157157
// Support: Extended
158158
// +optional
159+
// <gateway:experimental>
159160
Name *SectionName `json:"name,omitempty"`
160161

161162
// Matches define conditions used for matching the rule against incoming

apis/v1/httproute_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ type HTTPRouteRule struct {
138138
//
139139
// Support: Extended
140140
// +optional
141+
// <gateway:experimental>
141142
Name *SectionName `json:"name,omitempty"`
142143

143144
// Matches define conditions used for matching the rule against incoming

pkg/test/cel/httproute_test.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ import (
2323
"testing"
2424
"time"
2525

26-
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
27-
2826
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27+
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
2928
)
3029

3130
////////////////////////////////////////////////////////////////////////////////
@@ -1263,6 +1262,21 @@ func TestHTTPRouteRule(t *testing.T) {
12631262
},
12641263
},
12651264
},
1265+
{
1266+
name: "invalid because multiple names are repeated with others",
1267+
wantErrors: []string{"Rule name must be unique within the route"},
1268+
rules: []gatewayv1.HTTPRouteRule{
1269+
{
1270+
Name: ptrTo(gatewayv1.SectionName("name1")),
1271+
},
1272+
{
1273+
Name: ptrTo(gatewayv1.SectionName("not-name1")),
1274+
},
1275+
{
1276+
Name: ptrTo(gatewayv1.SectionName("name1")),
1277+
},
1278+
},
1279+
},
12661280
{
12671281
name: "valid because names are unique",
12681282
wantErrors: nil,

0 commit comments

Comments
 (0)