Skip to content

gatewayendpoint: keep an authorized hostname across a listener-only receipt change (APT-1361) - #30

Merged
reoring merged 2 commits into
mainfrom
fix/apt-1361-receipt-continuity
Nov 19, 2026
Merged

reoring merged 2 commits into
mainfrom
fix/apt-1361-receipt-continuity

Conversation

@reoring

@reoring reoring commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Why (APT-1361)

On appthrust.ink, platform #7157 closed existing Project Gateway listeners from allowedRoutes.namespaces.from: All to Same. The admission receipt stores sha256(json.Marshal(listener)) (receipt.go), so every listener digest changed; conflictsCurrentBinding then dropped every published hostname even though the routes stayed Accepted and their targets were unchanged. Events at 11:55:46Z: HostnameRemoved ×n and EndpointRecordSetDeleted; RecordSetPruned ×26; Route 53 change submitted 11:55:49Z; recreated RecordSets Programmed only at 11:57:46–11:58:20Z. All 13 published hosts were unreachable for 2–3 minutes (wildcard answer, TLS name mismatch).

Change

A receipt that differs from the current binding only by listener digest (same hostname, route namespace/name/UID/generation, Gateway UID/class, parentRef, listener name) is continued when all hold:

  • the current listener still admits the route: All, or Same/default with the route in the Gateway namespace; Selector fails closed (no Namespace read added); explicit kinds must include gateway.networking.k8s.io/HTTPRoute (httproute.go:122);
  • established targets are unchanged (or addresses temporarily absent while established targets are retained) (controller.go:272-275);
  • the route parent is Accepted (receipt refreshed to the new digest) or Unknown (old receipt kept unchanged until admission refreshes it) (controller.go:291-293,321-330).

Still withdrawn as before: Accepted=False, a cross-namespace route the new policy rejects, a removed listener, changed targets, a different route UID/generation, a disallowed kind. Fresh minting and Gateway UID replacement are unchanged. No new RBAC, errors, or reads.

Known, unchanged (separate issue)

After a correct withdrawal (e.g. cross-namespace under Same) and full ERS cleanup, a still-Accepted route status can mint the hostname again (controller.go:296-311), because fresh minting trusts route acceptance. Pre-existing; route acceptance freshness belongs to the Gateway controller.

Tests

receipt_continuity_test.go: SameNamespaceAccepted, SameNamespaceUnknownThenAccepted (ERS UID/spec/resourceVersion and receipt unchanged while Unknown; digest refreshed after Accepted; RecordSets unchanged and no provider DELETE/UPSERT in both phases), CrossNamespaceRejected/Unknown, ListenerRemoved, UnknownWithChangedTarget, UnknownWithRemovedListener, UnknownWithRejectedKind, RouteRejected, plus Selector/class/stale-generation/hostname-mismatch negatives.
go test -count=1 ./internal/go/apps/gatewayendpoint/controllers/gateway PASS (fake clients). go vet clean.

Authorship

Written by gpt-6.2-astra (deep-worker); commit by bugfixer. Review: Claude family (record po/lead-2026-11-14/reviews/dns-api-apt1361-continuity-security-review-bugfixer.md). Platform consumes this through a dns-api release and a pin update in hack/upstream-artifacts/shared-runtime-reviewed-imports.yaml.

…eceipt change (APT-1361)

- A receipt that differs from the current binding only by listener digest no longer withdraws the hostname when the route is still in an allowed namespace (All, or Same/default with the Gateway namespace; Selector fails closed), the listener still permits HTTPRoute, and the established targets are unchanged.
- While the route parent is Accepted the receipt is refreshed to the new listener digest; while it is Unknown the old receipt is kept unchanged until admission can refresh it. Accepted=False, cross-namespace routes the new policy rejects, removed listeners, changed targets and route UID/generation mismatches still withdraw.
- Fresh minting and Gateway UID replacement are unchanged.

On appthrust.ink, closing Project Gateway listeners from All to Same changed every listener digest, removed every published hostname, deleted or emptied the EndpointRecordSets, pruned their RecordSets and deleted the Route 53 answers; recreation took about two minutes.
…kinds (APT-1361)

- With allowedRoutes.kinds omitted, listener-only receipt continuity now requires an HTTP or HTTPS listener, so a same-name listener changed to TLS/TCP/UDP withdraws the hostname.
- Tests: HTTPS->TLS, address loss then a different target, Unknown then Rejected, Unknown then hostname mismatch; each first proves retention, then withdrawal through the provider.
- Docs: parent acceptance means the observedGeneration matching the current HTTPRoute generation.

Review F1/F2/F5 (probe-opus) on #30.
@reoring
reoring merged commit a5000e9 into main Nov 19, 2026
2 checks passed
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