Skip to content

Commit 3a96f4e

Browse files
committed
Spike adding Effective Policy Configuration to Route status
Signed-off-by: Sunjay Bhatia <[email protected]>
1 parent 02fc8af commit 3a96f4e

File tree

7 files changed

+1478
-38
lines changed

7 files changed

+1478
-38
lines changed

apis/v1alpha2/httproute_types.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// +kubebuilder:object:root=true
2525
// +kubebuilder:resource:categories=gateway-api
2626
// +kubebuilder:subresource:status
27-
// +kubebuilder:storageversion
27+
// +kubebuilder:unservedversion
2828
// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames`
2929
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
3030

@@ -332,9 +332,9 @@ const (
332332
//
333333
// Invalid values include:
334334
//
335-
// * ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
336-
// headers are not currently supported by this type.
337-
// * "/invalid" - "/" is an invalid character
335+
// - ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
336+
// headers are not currently supported by this type.
337+
// - "/invalid" - "/" is an invalid character
338338
//
339339
// +kubebuilder:validation:MinLength=1
340340
// +kubebuilder:validation:MaxLength=256
@@ -478,11 +478,13 @@ const (
478478
//
479479
// ```
480480
// match:
481-
// path:
482-
// value: "/foo"
483-
// headers:
484-
// - name: "version"
485-
// value "v1"
481+
//
482+
// path:
483+
// value: "/foo"
484+
// headers:
485+
// - name: "version"
486+
// value "v1"
487+
//
486488
// ```
487489
type HTTPRouteMatch struct {
488490
// Path specifies a HTTP request path matcher. If this field is not

apis/v1beta1/httproute_types.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
// +kubebuilder:object:root=true
2525
// +kubebuilder:resource:categories=gateway-api
2626
// +kubebuilder:subresource:status
27+
// +kubebuilder:storageversion
2728
// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames`
2829
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
2930

@@ -331,9 +332,9 @@ const (
331332
//
332333
// Invalid values include:
333334
//
334-
// * ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
335-
// headers are not currently supported by this type.
336-
// * "/invalid" - "/" is an invalid character
335+
// - ":method" - ":" is an invalid character. This means that HTTP/2 pseudo
336+
// headers are not currently supported by this type.
337+
// - "/invalid" - "/" is an invalid character
337338
//
338339
// +kubebuilder:validation:MinLength=1
339340
// +kubebuilder:validation:MaxLength=256
@@ -477,11 +478,13 @@ const (
477478
//
478479
// ```
479480
// match:
480-
// path:
481-
// value: "/foo"
482-
// headers:
483-
// - name: "version"
484-
// value "v1"
481+
//
482+
// path:
483+
// value: "/foo"
484+
// headers:
485+
// - name: "version"
486+
// value "v1"
487+
//
485488
// ```
486489
type HTTPRouteMatch struct {
487490
// Path specifies a HTTP request path matcher. If this field is not

apis/v1beta1/shared_types.go

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,23 @@ const (
259259
RouteReasonBackendNotFound RouteConditionReason = "BackendNotFound"
260260
)
261261

262+
// PolicyGroupKind indicates the group and kind of a Policy resource.
263+
type PolicyGroupKind struct {
264+
// Group is the group of the Policy.
265+
Group Group `json:"group,omitempty"`
266+
267+
// Kind is the kind of the Route.
268+
Kind Kind `json:"kind"`
269+
}
270+
271+
type RouteEffectivePolicyConfiguration struct {
272+
PolicyType PolicyGroupKind `json:"policyType"`
273+
274+
SectionName SectionName `json:"sectionName"`
275+
276+
PolicyValue string `json:"policyValue"`
277+
}
278+
262279
// RouteParentStatus describes the status of a route with respect to an
263280
// associated Parent.
264281
type RouteParentStatus struct {
@@ -306,6 +323,12 @@ type RouteParentStatus struct {
306323
// +kubebuilder:validation:MinItems=1
307324
// +kubebuilder:validation:MaxItems=8
308325
Conditions []metav1.Condition `json:"conditions,omitempty"`
326+
327+
// EffectivePolicyConfigurations is a list of policies in effect on this
328+
// Route.
329+
//
330+
// +optional
331+
EffectivePolicyConfigurations []RouteEffectivePolicyConfiguration `json:"effectivePolicyConfigurations"`
309332
}
310333

311334
// RouteStatus defines the common attributes that all Routes MUST include within
@@ -333,9 +356,9 @@ type RouteStatus struct {
333356
// Hostname is the fully qualified domain name of a network host. This matches
334357
// the RFC 1123 definition of a hostname with 2 notable exceptions:
335358
//
336-
// 1. IPs are not allowed.
337-
// 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
338-
// label must appear by itself as the first label.
359+
// 1. IPs are not allowed.
360+
// 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
361+
// label must appear by itself as the first label.
339362
//
340363
// Hostname can be "precise" which is a domain name without the terminating
341364
// dot of a network host (e.g. "foo.example.com") or "wildcard", which is a

apis/v1beta1/zz_generated.deepcopy.go

Lines changed: 36 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)