Skip to content

Commit

Permalink
Implement GRPCRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
gnossen committed Jul 18, 2022
1 parent 9537337 commit 2860f03
Show file tree
Hide file tree
Showing 31 changed files with 2,636 additions and 89 deletions.
461 changes: 461 additions & 0 deletions apis/v1alpha2/grpcroute_types.go

Large diffs are not rendered by default.

27 changes: 19 additions & 8 deletions apis/v1alpha2/httproute_types.go
Expand Up @@ -93,6 +93,13 @@ type HTTPRouteSpec struct {
// implementation must raise an 'Accepted' Condition with a status of
// `False` in the corresponding RouteParentStatus.
//
// If a Route (A) of type HTTPRoute or GRPCRoute is attached to a
// Listener and that listener already has another Route (B) of the other
// type attached and the intersection of the hostnames of A and B is
// non-empty, then the implementation must reject Route A. That is, the
// implementation must raise an 'Accepted' condition with a status of
// 'False' in the corresponding RouteParentStatus.
//
// Support: Core
//
// +optional
Expand Down Expand Up @@ -333,7 +340,9 @@ const (
// Invalid values include:
//
// * ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
// headers are not currently supported by this type.
//
// headers are not currently supported by this type.
//
// * "/invalid" - "/" is an invalid character
//
// +kubebuilder:validation:MinLength=1
Expand Down Expand Up @@ -476,14 +485,16 @@ const (
// For example, the match below will match a HTTP request only if its path
// starts with `/foo` AND it contains the `version: v1` header:
//
// ```
// `
// match:
// path:
// value: "/foo"
// headers:
// - name: "version"
// value "v1"
// ```
//
// path:
// value: "/foo"
// headers:
// - name: "version"
// value "v1"
//
// “`
type HTTPRouteMatch struct {
// Path specifies a HTTP request path matcher. If this field is not
// specified, a default prefix match on the "/" path is provided.
Expand Down
1 change: 0 additions & 1 deletion apis/v1alpha2/referencegrant_types.go
Expand Up @@ -36,7 +36,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// Gateway-route attachment) require a ReferenceGrant.
//
// Support: Core
//
type ReferenceGrant struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion apis/v1alpha2/referencepolicy_types.go
Expand Up @@ -40,7 +40,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// Gateway-route attachment) require a ReferenceGrant.
//
// Support: Core
//
type ReferencePolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion apis/v1alpha2/shared_types.go
Expand Up @@ -333,7 +333,8 @@ type RouteStatus struct {
//
// 1. IPs are not allowed.
// 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
// label must appear by itself as the first label.
//
// label must appear by itself as the first label.
//
// Hostname can be "precise" which is a domain name without the terminating
// dot of a network host (e.g. "foo.example.com") or "wildcard", which is a
Expand Down
3 changes: 2 additions & 1 deletion apis/v1alpha2/validation/gateway.go
Expand Up @@ -40,7 +40,8 @@ var (

// ValidateGateway validates gw according to the Gateway API specification.
// For additional details of the Gateway spec, refer to:
// https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.Gateway
//
// https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.Gateway
//
// Validation that is not possible with CRD annotations may be added here in the future.
// See https://github.com/kubernetes-sigs/gateway-api/issues/868 for more information.
Expand Down
2 changes: 1 addition & 1 deletion apis/v1alpha2/validation/httproute.go
Expand Up @@ -209,7 +209,7 @@ func validateHTTPQueryParamMatches(matches []gatewayv1a2.HTTPQueryParamMatch, pa
}

// validateHTTPRouteFilterTypeMatchesValue validates that only the expected fields are
//// set for the specified filter type.
// // set for the specified filter type.
func validateHTTPRouteFilterTypeMatchesValue(filter gatewayv1a2.HTTPRouteFilter, path *field.Path) field.ErrorList {
var errs field.ErrorList
if filter.ExtensionRef != nil && filter.Type != gatewayv1a2.HTTPRouteFilterExtensionRef {
Expand Down
269 changes: 269 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.

2 changes: 2 additions & 0 deletions apis/v1alpha2/zz_generated.register.go

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

0 comments on commit 2860f03

Please sign in to comment.