From 6eb3950441613d6ef13c80f9b73d61acc30a026c Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Sat, 23 Sep 2023 01:32:08 +0000 Subject: [PATCH] Adding new PartiallyInvalid condition for Routes --- apis/v1beta1/shared_types.go | 48 +++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/apis/v1beta1/shared_types.go b/apis/v1beta1/shared_types.go index 369328b530..7310627478 100644 --- a/apis/v1beta1/shared_types.go +++ b/apis/v1beta1/shared_types.go @@ -263,7 +263,7 @@ const ( // This condition indicates whether the route has been accepted or rejected // by a Gateway, and why. // - // Possible reasons for this condition to be true are: + // Possible reasons for this condition to be True are: // // * "Accepted" // @@ -314,15 +314,17 @@ const ( // are incompatible filters present on a route rule (for example if // the URLRewrite and RequestRedirect are both present on an HTTPRoute). RouteReasonIncompatibleFilters RouteConditionReason = "IncompatibleFilters" +) +const ( // This condition indicates whether the controller was able to resolve all // the object references for the Route. // - // Possible reasons for this condition to be true are: + // Possible reasons for this condition to be True are: // // * "ResolvedRefs" // - // Possible reasons for this condition to be false are: + // Possible reasons for this condition to be False are: // // * "RefNotPermitted" // * "InvalidKind" @@ -353,6 +355,46 @@ const ( RouteReasonBackendNotFound RouteConditionReason = "BackendNotFound" ) +const ( + // This condition indicates that the Route contains a combination of both + // valid and invalid rules. + // + // When this happens, implementations MUST take one of the following + // approaches: + // + // 1) Drop Rule(s): With this approach, implementations will drop the + // invalid Route Rule(s) until they are fully valid again. The message + // for this condition MUST start with the prefix "Dropped Rule" and + // include information about which Rules have been dropped. In this + // state, the "Accepted" condition MUST be set to "True" with the latest + // generation of the resource. + // 2) Fall Back: With this approach, implementations will fall back to the + // last known good state of the entire Route. The message for this + // condition MUST start with the prefix "Fall Back" and include + // information about why the current Rule(s) are invalid. To represent + // this, the "Accepted" condition MUST be set to "True" with the + // generation of the last known good state of the resource. + // + // Reverting to the last known good state should only be done by + // implementations that have a means of restoring that state if/when they + // are restarted. + // + // This condition MUST NOT be set if a Route is fully valid, fully invalid, + // or not accepted. + // + // Possible reasons for this condition to be True are: + // + // * "UnsupportedValue" + // + // Possible reasons for this condition to be False are: + // + // * "PartiallyInvalid" + // + // Controllers may raise this condition with other reasons, but should + // prefer to use the reasons listed above to improve interoperability. + RouteConditionPartiallyInvalid RouteConditionType = "PartiallyInvalid" +) + // RouteParentStatus describes the status of a route with respect to an // associated Parent. type RouteParentStatus struct {