Skip to content

Commit

Permalink
small wording
Browse files Browse the repository at this point in the history
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
  • Loading branch information
zhaohuabing committed Aug 14, 2023
1 parent 9442d87 commit e25f9ce
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 5 deletions.
9 changes: 9 additions & 0 deletions apis/v1alpha2/tcproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ type TCPRouteStatus struct {

// TCPRouteRule is the configuration for a given rule.
type TCPRouteRule struct {
// Name is the name of the Route rule. If more than one Route Rule is
// present, each Rule MUST specify a name. The names of Rules MUST be unique
// within a Route.
//
// Support: Core
//
// +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
// Service with no endpoints), the underlying implementation MUST actively
Expand Down
9 changes: 9 additions & 0 deletions apis/v1alpha2/tlsroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ type TLSRouteStatus struct {

// TLSRouteRule is the configuration for a given rule.
type TLSRouteRule struct {
// Name is the name of the Route rule. If more than one Route Rule is
// present, each Rule MUST specify a name. The names of Rules MUST be unique
// within a Route.
//
// Support: Core
//
// +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 Service with no endpoints), the rule performs no forwarding; if no
Expand Down
9 changes: 9 additions & 0 deletions apis/v1alpha2/udproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ type UDPRouteStatus struct {

// UDPRouteRule is the configuration for a given rule.
type UDPRouteRule struct {
// Name is the name of the Route rule. If more than one Route Rule is
// present, each Rule MUST specify a name. The names of Rules MUST be unique
// within a Route.
//
// Support: Core
//
// +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
// Service with no endpoints), the underlying implementation MUST actively
Expand Down
9 changes: 9 additions & 0 deletions apis/v1beta1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ type HTTPRouteSpec struct {
// +kubebuilder:validation:XValidation:message="Within backendRefs, when using RequestRedirect filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified",rule="(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.requestRedirect) && has(f.requestRedirect.path) && f.requestRedirect.path.type == 'ReplacePrefixMatch' && has(f.requestRedirect.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != 'PathPrefix') ? false : true) : true"
// +kubebuilder:validation:XValidation:message="Within backendRefs, When using URLRewrite filter with path.replacePrefixMatch, exactly one PathPrefix match must be specified",rule="(has(self.backendRefs) && self.backendRefs.exists_one(b, (has(b.filters) && b.filters.exists_one(f, has(f.urlRewrite) && has(f.urlRewrite.path) && f.urlRewrite.path.type == 'ReplacePrefixMatch' && has(f.urlRewrite.path.replacePrefixMatch))) )) ? ((size(self.matches) != 1 || !has(self.matches[0].path) || self.matches[0].path.type != 'PathPrefix') ? false : true) : true"
type HTTPRouteRule struct {
// Name is the name of the Route rule. If more than one Route Rule is
// present, each Rule MUST specify a name. The names of Rules MUST be unique
// within a Route.
//
// Support: Core
//
// +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
// if **any** one of the matches is satisfied.
Expand Down
10 changes: 5 additions & 5 deletions geps/gep-713.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,11 @@ the same behavior and semantics, although they may not be able to support
attachment of all types of policy at all potential attachment points.

### Apply Policies to Sections of a Resource
Policies can be targeted at specific matches within nested objects. For example,
it's useful to attach policies to a specific Gateway listeners.
Policies can target specific matches within nested objects. For instance, rather than
applying a policy to the entire Gateway, we may want to attach it to a particular Gateway listener.

For example, an optional `sectionName` field can be set in the `targetRef` of a policy
to refer to a specific listener in the target Gateway.
To achieve this, an optional `sectionName` field can be set in the `targetRef` of a policy
to refer to a specific listener within the target Gateway.

```yaml
apiVersion: networking.acme.io/v1alpha2
Expand All @@ -709,7 +709,7 @@ The `sectionName` field could also be used to target a specific section of other
* xRoute.Rules.Name
* Service.Ports.Name

This would require adding a `Name` field to those sub-resources that don't have a name yet. For example,
This would require adding a `Name` field to those sub-resources that currently lack a name. For example,
a `Name` field could be added to the `RouteRule` object:
```go
type RouteRule struct {
Expand Down

0 comments on commit e25f9ce

Please sign in to comment.