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

Add route not allowed status for GWAPI routes #2417

Closed
rainest opened this issue Apr 18, 2022 · 4 comments
Closed

Add route not allowed status for GWAPI routes #2417

rainest opened this issue Apr 18, 2022 · 4 comments
Labels
area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API nice-to-have priority/low

Comments

@rainest
Copy link
Contributor

rainest commented Apr 18, 2022

When a GWAPI Route controller cannot ingest a Route because it does not match any of the listeners' AllowedRoutes criteria, we should set a status indicating this.

This status does not yet exist upstream. Adding it is blocked on related pending upstream changes. See #2389 (comment) for details.

@shaneutt shaneutt added priority/medium area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API labels Apr 18, 2022
@shaneutt shaneutt added this to the Gateway API - Milestone 2 milestone Apr 18, 2022
@shaneutt shaneutt self-assigned this May 3, 2022
@shaneutt
Copy link
Contributor

shaneutt commented May 3, 2022

Blocked on kubernetes-sigs/gateway-api#1111, which appears to be requesting something similar that can serve the same purpose. Over a week ago someone mentioned they were taking it on, I'm inquiring whether they're still doing that and if so we'll continue holding this as blocked and if not I'll make the PR myself.

@shaneutt
Copy link
Contributor

shaneutt commented May 4, 2022

Alright looks like I'll be taking on kubernetes-sigs/gateway-api#1111, unblocked.

@shaneutt shaneutt added waiting-on-pr-review This work is on-hold, specifically because no further work can be done until review is complete and removed blocked waiting-on-pr-review This work is on-hold, specifically because no further work can be done until review is complete labels May 4, 2022
@shaneutt
Copy link
Contributor

shaneutt commented May 9, 2022

After doing some more catching up on recent events in Gateway, it looks like https://github.com/kubernetes-sigs/gateway-api/pull/1114/files actually provided what we need to resolve this as we were just looking for a status update for invalid routes. So now the implementation is to simply mark accepted as false and provide a clear reason when a route is rejected and we should be all set. this does not however need to hold up the milestone so I'm removing that.

@shaneutt shaneutt removed their assignment May 9, 2022
@shaneutt shaneutt removed this from the Gateway API - Milestone 2 milestone May 9, 2022
@rainest
Copy link
Contributor Author

rainest commented Jun 6, 2023

This appears to be done as of 525b2f4

After that we began appending Gateways with not allowed reasons to route status. Closing pending something I'm missing, but I can't think of anything:

} else {
// We failed to match a listener with this route
// This will also catch a case of not matching listener/section name.
reason := RouteReasonNoMatchingParent
if matchingHostname != nil && *matchingHostname == metav1.ConditionFalse {
// If there is no matchingHostname, the gateway Status Condition Accepted
// must be set to False with reason NoMatchingListenerHostname
reason = gatewayv1beta1.RouteReasonNoMatchingListenerHostname
} else if (parentRef.Port != nil) && !portMatched {
// If ParentRef specified a Port but none of the listeners matched, the gateway Status
// Condition Accepted must be set to False with reason NoMatchingListenerPort
reason = RouteReasonNoMatchingParent
} else if !allowedByAllowedRoutes || !allowedBySupportedKinds {
reason = gatewayv1beta1.RouteReasonNotAllowedByListeners
}
var listenerName string
if parentRef.SectionName != nil && *parentRef.SectionName != "" {
listenerName = string(*parentRef.SectionName)
}
gateways = append(gateways, supportedGatewayWithCondition{
gateway: &gateway,
listenerName: listenerName,
condition: metav1.Condition{
Type: string(gatewayv1beta1.RouteConditionAccepted),
Status: metav1.ConditionFalse,
Reason: string(reason),
},
})
}
}

@rainest rainest closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API nice-to-have priority/low
Projects
None yet
Development

No branches or pull requests

2 participants