Skip to content

Commit 2860f03

Browse files
committed
Implement GRPCRoute
1 parent 9537337 commit 2860f03

31 files changed

+2636
-89
lines changed

apis/v1alpha2/grpcroute_types.go

Lines changed: 461 additions & 0 deletions
Large diffs are not rendered by default.

apis/v1alpha2/httproute_types.go

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ type HTTPRouteSpec struct {
9393
// implementation must raise an 'Accepted' Condition with a status of
9494
// `False` in the corresponding RouteParentStatus.
9595
//
96+
// If a Route (A) of type HTTPRoute or GRPCRoute is attached to a
97+
// Listener and that listener already has another Route (B) of the other
98+
// type attached and the intersection of the hostnames of A and B is
99+
// non-empty, then the implementation must reject Route A. That is, the
100+
// implementation must raise an 'Accepted' condition with a status of
101+
// 'False' in the corresponding RouteParentStatus.
102+
//
96103
// Support: Core
97104
//
98105
// +optional
@@ -333,7 +340,9 @@ const (
333340
// Invalid values include:
334341
//
335342
// * ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
336-
// headers are not currently supported by this type.
343+
//
344+
// headers are not currently supported by this type.
345+
//
337346
// * "/invalid" - "/" is an invalid character
338347
//
339348
// +kubebuilder:validation:MinLength=1
@@ -476,14 +485,16 @@ const (
476485
// For example, the match below will match a HTTP request only if its path
477486
// starts with `/foo` AND it contains the `version: v1` header:
478487
//
479-
// ```
488+
// `
480489
// match:
481-
// path:
482-
// value: "/foo"
483-
// headers:
484-
// - name: "version"
485-
// value "v1"
486-
// ```
490+
//
491+
// path:
492+
// value: "/foo"
493+
// headers:
494+
// - name: "version"
495+
// value "v1"
496+
//
497+
// “`
487498
type HTTPRouteMatch struct {
488499
// Path specifies a HTTP request path matcher. If this field is not
489500
// specified, a default prefix match on the "/" path is provided.

apis/v1alpha2/referencegrant_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3636
// Gateway-route attachment) require a ReferenceGrant.
3737
//
3838
// Support: Core
39-
//
4039
type ReferenceGrant struct {
4140
metav1.TypeMeta `json:",inline"`
4241
metav1.ObjectMeta `json:"metadata,omitempty"`

apis/v1alpha2/referencepolicy_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4040
// Gateway-route attachment) require a ReferenceGrant.
4141
//
4242
// Support: Core
43-
//
4443
type ReferencePolicy struct {
4544
metav1.TypeMeta `json:",inline"`
4645
metav1.ObjectMeta `json:"metadata,omitempty"`

apis/v1alpha2/shared_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ type RouteStatus struct {
333333
//
334334
// 1. IPs are not allowed.
335335
// 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
336-
// label must appear by itself as the first label.
336+
//
337+
// label must appear by itself as the first label.
337338
//
338339
// Hostname can be "precise" which is a domain name without the terminating
339340
// dot of a network host (e.g. "foo.example.com") or "wildcard", which is a

apis/v1alpha2/validation/gateway.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ var (
4040

4141
// ValidateGateway validates gw according to the Gateway API specification.
4242
// For additional details of the Gateway spec, refer to:
43-
// https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.Gateway
43+
//
44+
// https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.Gateway
4445
//
4546
// Validation that is not possible with CRD annotations may be added here in the future.
4647
// See https://github.com/kubernetes-sigs/gateway-api/issues/868 for more information.

apis/v1alpha2/validation/httproute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func validateHTTPQueryParamMatches(matches []gatewayv1a2.HTTPQueryParamMatch, pa
209209
}
210210

211211
// validateHTTPRouteFilterTypeMatchesValue validates that only the expected fields are
212-
//// set for the specified filter type.
212+
// // set for the specified filter type.
213213
func validateHTTPRouteFilterTypeMatchesValue(filter gatewayv1a2.HTTPRouteFilter, path *field.Path) field.ErrorList {
214214
var errs field.ErrorList
215215
if filter.ExtensionRef != nil && filter.Type != gatewayv1a2.HTTPRouteFilterExtensionRef {

apis/v1alpha2/zz_generated.deepcopy.go

Lines changed: 269 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha2/zz_generated.register.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)