Skip to content

[HYPERSHELL-76] feat(gateway): gate Running phase on Gateway route readiness - #131

Open
jsell-rh wants to merge 7 commits into
mainfrom
feat/gateway-route-readiness
Open

[HYPERSHELL-76] feat(gateway): gate Running phase on Gateway route readiness#131
jsell-rh wants to merge 7 commits into
mainfrom
feat/gateway-route-readiness

Conversation

@jsell-rh

Copy link
Copy Markdown
Collaborator

Summary

A gateway was reported Running (and its OpenShell connect command surfaced) as soon as its Deployment was ready — before the underlying Gateway API resource was actually Programmed=True with an assigned address. Users could copy a connect command that pointed at an endpoint the mesh could not yet route to.

This branch gates the Running phase on route readiness: the gateway stays Provisioning until the Gateway that fronts its route is observed Programmed=True with an address, then transitions to Running. If it never programs, it stays Provisioning and degrades after a grace window (GATEWAY_ROUTE_READY_TIMEOUT, default 10m).

Implements spec 4c92205 (specs/platform/openshell-gateway-health.spec.md).

Changes

  • control-plane (46e926b): Gateway Exposure port + Gateway API adapter (hexagonal). The route address may be published before readiness; the health reconciler promotes Provisioning -> Running only after observing Programmed=True + address, and -> Degraded after the route-ready timeout. Reads status via typed sigs.k8s.io/gateway-api. Correctly handles the shared-Gateway topology (one shared Gateway + per-tenant GRPCRoute).
  • web-console / gateway-management-ui (837520f): centralize the connect gate through isGatewayReadyToConnect (phase === "Running" AND endpoint present). route_address may be present before readiness, so the CLI command and login step are withheld until Running; a provisioning affordance is shown instead.
  • e2e (a7c1019): refresh the OIDC token inside the provisioning poll — provisioning can outlast the token lifetime, which previously caused a false timeout.

Testing

  • gateway-management-ui unit tests cover the readiness gate (isGatewayReadyToConnect, buildGatewayAddCommand, connection-steps, page-level withholding).
  • control-plane unit tests cover exposure + health transitions (including never-programmed -> Degraded).
  • Full e2e on local Kind: 37 passed, 0 failed. Verified live that the gateway holds at Provisioning while awaiting route readiness, publishes route_address before readiness, then promotes to Running (Healthy) only after the fronting Gateway is Programmed=True with an address; the API then returns phase=Running + route_address, the OpenShell CLI connects, and a sandbox is created and exec'd into.

🤖 Generated with Claude Code

user and others added 5 commits August 14, 2026 14:53
… port

A routed gateway is currently reported Running (and its connect command
surfaced) as soon as its Deployment is Ready, ignoring whether the underlying
Gateway API Gateway is Programmed with an assigned address. Users get a command
pointing at an endpoint that is not yet routable.

Refine the health and routing specs so that:
- Running for a routed gateway additionally requires its external exposure to be
  observed Ready (Gateway API adapter: Programmed=True + non-empty
  .status.addresses); otherwise phase stays Provisioning, then Degraded after a
  grace window (GATEWAY_ROUTE_READY_TIMEOUT, default 10m).
- The console/CLI surface the connection command as ready only at phase Running.
- Address resolution and readiness observation live behind an application-owned
  Gateway Exposure port, with the Gateway API implementation as one adapter and
  OpenShift Route / passthrough Route adapters expected to plug in unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Introduce a Gateway Exposure port (internal/exposure) with a Gateway API
adapter that both resolves the external route address and observes route
readiness (Programmed=True with an assigned address). Wire the port into
the provisioning reconciler and the health reconciler so a routed gateway
stays Provisioning until its underlying Gateway is programmed and routable,
moving to Degraded only after a configurable grace window
(GATEWAY_ROUTE_READY_TIMEOUT, default 10m). A gateway that reaches Running
and later loses readiness is marked Degraded immediately.

The port/adapter boundary keeps address resolution and readiness observation
behind an application-owned interface so additional exposure backends (routes,
passthrough routes) can be added without touching the reconcilers.

Implements specs/platform/openshell-gateway-health.spec.md and
openshell-gateway-routing.spec.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nning

The gateway detail Connection tab and the row-action "Copy CLI connection
command" previously appeared as soon as an endpoint (route address) was
published. Because the route address is derived and published before the
underlying Gateway is programmed and routable, this handed users a command
targeting an endpoint that was not yet reachable.

Add isGatewayReadyToConnect (phase === "Running" AND endpoint present) and
route the connection command through it: carry `phase` onto GatewayConnection,
gate buildGatewayAddCommand (which both the detail header and row action use)
and the login step. While provisioning, the login step now shows a
provisioning affordance instead of the command.

Implements the "Connection Command Surfaced Only When Ready" requirement in
specs/platform/openshell-gateway-health.spec.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The provisioning poll reused the access token acquired before the loop.
Gateway provisioning can outlast the token lifetime, after which every
api_curl got a 401 and the phase read back empty ("unknown"), so the
poll timed out even though the gateway had reached Running. Re-acquire
the token each iteration; api_curl reads _OIDC_ACCESS_TOKEN per call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…into feat/gateway-route-readiness

# Conflicts:
#	components/control-plane/internal/gateway/reconciler.go
#	specs/platform/openshell-gateway-routing.spec.md
@jsell-rh jsell-rh changed the title feat(gateway): gate Running phase on Gateway route readiness [HYPERSHELL-76] feat(gateway): gate Running phase on Gateway route readiness Aug 14, 2026
user and others added 2 commits August 14, 2026 16:45
…essage

The connectionLoginUnavailable message copy changed but the extracted
locale bundle was not regenerated, so the web-console i18n:check gate
(cmp of locales/en.json against a fresh formatjs extract) failed in CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The connection command now surfaces only when a gateway's phase is
"Running" (isGatewayReadyToConnect), so the shared gateway fixture must
report Running for the connection-command journeys, and the login-step
pending assertion must use the new "still provisioning" message. Also
await the details-page h1 before the axe scan to deflake the unknown-
status theme check.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant