Skip to content

Commit

Permalink
Make it a pointer type
Browse files Browse the repository at this point in the history
  • Loading branch information
howardjohn committed Apr 18, 2024
1 parent f244632 commit 07a0a93
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apis/v1/grpcroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ type GRPCRouteRule struct {
// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
//
// Support: Extended
Name SectionName `json:"name,omitempty"`
// +optional
Name *SectionName `json:"name,omitempty"`

// Matches define conditions used for matching the rule against incoming
// gRPC requests. Each match is independent, i.e. this rule will be matched
Expand Down
3 changes: 2 additions & 1 deletion apis/v1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ type HTTPRouteRule struct {
// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
//
// Support: Extended
Name SectionName `json:"name,omitempty"`
// +optional
Name *SectionName `json:"name,omitempty"`

// Matches define conditions used for matching the rule against incoming
// HTTP requests. Each match is independent, i.e. this rule will be matched
Expand Down
10 changes: 10 additions & 0 deletions apis/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apis/v1alpha2/tcproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ type TCPRouteRule struct {
// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
//
// Support: Extended
Name SectionName `json:"name,omitempty"`
// +optional
Name *SectionName `json:"name,omitempty"`

// BackendRefs defines the backend(s) where matching requests should be
// sent. If unspecified or invalid (refers to a non-existent resource or a
Expand Down
3 changes: 2 additions & 1 deletion apis/v1alpha2/tlsroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ type TLSRouteRule struct {
// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
//
// Support: Extended
Name SectionName `json:"name,omitempty"`
// +optional
Name *SectionName `json:"name,omitempty"`

// BackendRefs defines the backend(s) where matching requests should be
// sent. If unspecified or invalid (refers to a non-existent resource or
Expand Down
3 changes: 2 additions & 1 deletion apis/v1alpha2/udproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ type UDPRouteRule struct {
// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
//
// Support: Extended
Name SectionName `json:"name,omitempty"`
// +optional
Name *SectionName `json:"name,omitempty"`

// BackendRefs defines the backend(s) where matching requests should be
// sent. If unspecified or invalid (refers to a non-existent resource or a
Expand Down
15 changes: 15 additions & 0 deletions apis/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/test/cel/httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1214,10 +1214,10 @@ func TestHTTPRouteRule(t *testing.T) {
wantErrors: []string{"Route name must be unique within the route"},
rules: []gatewayv1.HTTPRouteRule{
{
Name: "name1",
Name: ptrTo(gatewayv1.SectionName("name1")),
},
{
Name: "name1",
Name: ptrTo(gatewayv1.SectionName("name1")),
},
},
},
Expand Down

0 comments on commit 07a0a93

Please sign in to comment.