Skip to content

Commit

Permalink
Spike adding Effective Policy Configuration to Route status
Browse files Browse the repository at this point in the history
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed Nov 7, 2022
1 parent 02fc8af commit 3a96f4e
Show file tree
Hide file tree
Showing 7 changed files with 1,478 additions and 38 deletions.
20 changes: 11 additions & 9 deletions apis/v1alpha2/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=gateway-api
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:unservedversion
// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

Expand Down Expand Up @@ -332,9 +332,9 @@ const (
//
// Invalid values include:
//
// * ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
// headers are not currently supported by this type.
// * "/invalid" - "/" is an invalid character
// - ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
// headers are not currently supported by this type.
// - "/invalid" - "/" is an invalid character
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
Expand Down Expand Up @@ -478,11 +478,13 @@ const (
//
// ```
// 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
Expand Down
19 changes: 11 additions & 8 deletions apis/v1beta1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories=gateway-api
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

Expand Down Expand Up @@ -331,9 +332,9 @@ const (
//
// Invalid values include:
//
// * ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
// headers are not currently supported by this type.
// * "/invalid" - "/" is an invalid character
// - ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
// headers are not currently supported by this type.
// - "/invalid" - "/" is an invalid character
//
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
Expand Down Expand Up @@ -477,11 +478,13 @@ const (
//
// ```
// 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
Expand Down
29 changes: 26 additions & 3 deletions apis/v1beta1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,23 @@ const (
RouteReasonBackendNotFound RouteConditionReason = "BackendNotFound"
)

// PolicyGroupKind indicates the group and kind of a Policy resource.
type PolicyGroupKind struct {
// Group is the group of the Policy.
Group Group `json:"group,omitempty"`

// Kind is the kind of the Route.
Kind Kind `json:"kind"`
}

type RouteEffectivePolicyConfiguration struct {
PolicyType PolicyGroupKind `json:"policyType"`

SectionName SectionName `json:"sectionName"`

PolicyValue string `json:"policyValue"`
}

// RouteParentStatus describes the status of a route with respect to an
// associated Parent.
type RouteParentStatus struct {
Expand Down Expand Up @@ -306,6 +323,12 @@ type RouteParentStatus struct {
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=8
Conditions []metav1.Condition `json:"conditions,omitempty"`

// EffectivePolicyConfigurations is a list of policies in effect on this
// Route.
//
// +optional
EffectivePolicyConfigurations []RouteEffectivePolicyConfiguration `json:"effectivePolicyConfigurations"`
}

// RouteStatus defines the common attributes that all Routes MUST include within
Expand Down Expand Up @@ -333,9 +356,9 @@ type RouteStatus struct {
// Hostname is the fully qualified domain name of a network host. This matches
// the RFC 1123 definition of a hostname with 2 notable exceptions:
//
// 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.
// 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.
//
// 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
36 changes: 36 additions & 0 deletions apis/v1beta1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 3a96f4e

Please sign in to comment.