Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: add RouteConditionReason to v1alpha2 #1114

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions apis/v1alpha2/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,51 @@ type BackendRef struct {
// RouteConditionType is a type of condition for a route.
type RouteConditionType string

// RouteConditionReason is a reason for a route condition.
type RouteConditionReason string

const (
// This condition indicates whether the route has been accepted or rejected
// by a Gateway, and why.
ConditionRouteAccepted RouteConditionType = "Accepted"
//
// Possible reasons for this condition to be true are:
//
// * "Accepted"
//
// Controllers may raise this condition with other reasons,
// but should prefer to use the reasons listed above to improve
// interoperability.
RouteConditionAccepted RouteConditionType = "Accepted"

// This reason is used with the "Accepted" condition when the Route has been
// accepted by the Gateway.
RouteReasonAccepted RouteConditionReason = "Accepted"

// This condition indicates whether the controller was able to resolve all
// the object references for the Route.
ConditionRouteResolvedRefs RouteConditionType = "ResolvedRefs"
//
// Possible reasons for this condition to be true are:
//
// * "ResolvedRefs"
//
// Possible reasons for this condition to be false are:
//
// * "RefNotPermitted"
//
// Controllers may raise this condition with other reasons,
// but should prefer to use the reasons listed above to improve
// interoperability.
RouteConditionResolvedRefs RouteConditionType = "ResolvedRefs"

// This reason is used with the "ResolvedRefs" condition when the condition
// is true.
RouteReasonResolvedRefs RouteConditionReason = "ResolvedRefs"

// This reason is used with the "ResolvedRefs" condition when
// one of the Listener's Routes has a BackendRef to an object in
// another namespace, where the object in the other namespace does
// not have a ReferencePolicy explicitly allowing the reference.
RouteReasonRefNotPermitted RouteConditionReason = "RefNotPermitted"
)

// RouteParentStatus describes the status of a route with respect to an
Expand Down
2 changes: 1 addition & 1 deletion conformance/utils/kubernetes/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func GatewayAndHTTPRoutesMustBeReady(t *testing.T, c client.Client, controllerNa
},
ControllerName: v1alpha2.GatewayController(controllerName),
Conditions: []metav1.Condition{{
Type: string(v1alpha2.ConditionRouteAccepted),
Type: string(v1alpha2.RouteConditionAccepted),
Status: metav1.ConditionTrue,
}},
}}
Expand Down