File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ type GRPCRouteRule struct {
156
156
//
157
157
// Support: Extended
158
158
// +optional
159
+ // <gateway:experimental>
159
160
Name * SectionName `json:"name,omitempty"`
160
161
161
162
// Matches define conditions used for matching the rule against incoming
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ type HTTPRouteRule struct {
138
138
//
139
139
// Support: Extended
140
140
// +optional
141
+ // <gateway:experimental>
141
142
Name * SectionName `json:"name,omitempty"`
142
143
143
144
// Matches define conditions used for matching the rule against incoming
Original file line number Diff line number Diff line change @@ -23,9 +23,8 @@ import (
23
23
"testing"
24
24
"time"
25
25
26
- gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
27
-
28
26
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27
+ gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
29
28
)
30
29
31
30
////////////////////////////////////////////////////////////////////////////////
@@ -1263,6 +1262,21 @@ func TestHTTPRouteRule(t *testing.T) {
1263
1262
},
1264
1263
},
1265
1264
},
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
+ },
1266
1280
{
1267
1281
name : "valid because names are unique" ,
1268
1282
wantErrors : nil ,
You can’t perform that action at this time.
0 commit comments