Repository navigation
Conversation
|
📄 Docs preview for |
Add the pieces that turn an applied AIGatewayRoute into an endpoint condition based on whether its Gateway accepted the generated HTTPRoute. Nothing calls them yet, so reconciler behavior is unchanged. - readRouteAcceptance gets the HTTPRoute of the same name, checks that it still mirrors the route's parentRef and hostnames, and takes the Accepted condition of the matching status.parents entry only when its observedGeneration is current. It also picks up the AIGatewayRoute's NotAccepted message. - routeAcceptanceCondition reports True/Applied when accepted, otherwise Unknown/RoutePending while a 2 minute creation window or previous condition window is open, then False/RouteNotAccepted naming the Gateway and listener. - endpointCondition keeps ApplyFailed and GatewayCRDUnavailable as before, reports other read errors as Unknown/RouteStatusUnreadable (or keeps a RouteNotAccepted latch with the error appended once), and stamps lastTransitionTime from an injected clock. - gatewayRequeue now keys on reason at any status and returns the shortest interval (RoutePending 5s, RouteStatusUnreadable 15s, RouteNotAccepted 1m). hasGatewayFailure becomes its own predicate and counts RouteNotAccepted, but not the pending or unreadable reasons. - Document the contracts and patterns in docs/architecture and point AGENTS.md at them.
dcmcand
force-pushed
the
feat/233-route-acceptance-core
branch
from
November 20, 2026 16:09
c80838c to
8274d28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 1: Route acceptance can be read and turned into a condition
Part of #233. Today an endpoint condition says
Appliedas soon as the AIGatewayRoute is written, even when the Gateway rejects the generated HTTPRoute (for example a missing listener givesAccepted=False/NoMatchingParent). This PR adds a tested reader and derivation that turn the applied AIGatewayRoute plus its generated HTTPRoute into the endpoint condition, and teaches the requeue and failure helpers the new reasons. Nothing calls them yet, so reconciler behavior is unchanged; the PassthroughModel and LLMModel reconcilers adopt them in the next two PRs of this stack.Spec / plan: design notes for #233 (kept outside the repo); this is slice 1 of 3.
Contracts touched:
gatewayRequeue,hasGatewayFailure,phaseWithGatewayFailure(unchanged, picks upRouteNotAccepted),endpointCondition,readRouteAcceptance,routeAcceptanceCondition. Recorded in the newdocs/architecture/contracts.md.Depends on: #173
What changes
readRouteAcceptancegets the HTTPRoute of the same name, treats it as stale unless its parentRef and hostnames still match the AIGatewayRoute, and uses the matchingstatus.parents[]entry'sAcceptedcondition only when itsobservedGenerationequals the HTTPRoute generation.routeAcceptanceCondition:True/Appliedwhen accepted; otherwiseUnknown/RoutePendingwhile a 2 minute creation window or previous-condition window is open, thenFalse/RouteNotAcceptednaming the Gateway and listener (with the Envoy Gateway reason, or the AI Gateway message when there is one).endpointCondition: keepsApplyFailed/GatewayCRDUnavailable; other read errors areUnknown/RouteStatusUnreadable, or keep an existingRouteNotAcceptedwith the error appended once;lastTransitionTimecomes from an injected clock.gatewayRequeuekeys on reason at any status and returns the shortest interval:RoutePending5 s,GatewayCRDUnavailable15 s,RouteStatusUnreadable15 s,RouteNotAcceptedandApplyFailed1 min.hasGatewayFailurecountsRouteNotAcceptedbut not the pending or unreadable reasons. Existing inputs give existing outputs.AGENTS.md,docs/architecture/contracts.md,docs/architecture/patterns.md.Validation
cd operator && make testokgo test ./internal/controller/ -run 'TestGatewayRequeue|TestPhaseWithGatewayFailure|TestShortestRequeue|TestReadRouteAcceptance|TestRouteAcceptanceCondition|TestEndpointCondition' -vTestGatewayRequeuerows untouched (0 removed lines inconditions_test.go)lint.yamlruns it0 issues.Live pre-flight, checking the assumptions the reader relies on:
creationTimestampandstatus(kubectl replace -o yamlon the AIGatewayRoute).spec.parentRefs,spec.hostnamesandstatus.parents[].parentRefmatch the AIGatewayRoute's exactly;parentRef.namespaceis present in status.AcceptedobservedGenerationboth moved 1 -> 2 within 2 s.InternalEndpointReady=True/Appliedwhile the HTTPRoute wasAccepted=False/NoMatchingParentbecause thellm-internal-httpslistener was missing.