Repository navigation
Conversation
oktalz
force-pushed
the
hotfix-hug-routes
branch
from
October 16, 2026 17:56
2f6fc50 to
b3db07b
Compare
g-patton
force-pushed
the
hotfix-hug-routes
branch
from
October 16, 2026 18:35
b3db07b to
e8e8986
Compare
Route deletion and invalidation scheduled backend deletion even when unchanged routes still owned the backend. The same-cycle update safeguard did not protect those surviving routes. Use the existing unreferenced-backend cleanup in all four HTTPRoute and TLSRoute handlers so remaining owners determine backend retention. Add twelve regression cases covering deletion, invalidation, shared owners, and final-owner cleanup.
oktalz
force-pushed
the
hotfix-hug-routes
branch
from
November 25, 2026 22:17
e8e8986 to
e0ada99
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.
Summary
Preserve shared backends when an HTTPRoute or TLSRoute is deleted or invalidated and unchanged routes still reference that backend.
The four affected handlers currently remove route ownership and immediately schedule backend deletion. The same-cycle
Upsertedsafeguard does not protect unchanged surviving owners. Queue the backend in the existingUnreferencedcleanup path instead, so ownership determines whether deletion is appropriate.This is a targeted four-handler change plus a 12-case regression test; no unrelated refactoring.
Reproduction
Route invalidation exercises the same ownership problem.
Regression coverage
TestSharedBackendRouteRemovalcovers HTTPRoute/TLSRoute × deletion/invalidation × zero/one/two surviving owners. It checks deletion decisions, surviving ownership metadata, and retained servers.Additional completed local validation
Disposable kind real-traffic environment: Kubernetes 1.36.1, Gateway API 1.3.0 CRDs, ARM64, and corresponding stock-image HAProxy runtimes with only the patched controller binary replaced. Four stock-image scenarios reproduced the failure (HTTP/HTTPS and TLS passthrough on each version).
Across 18 patched scenarios on the two versions, 6,285 sampled survivor requests had zero observed failures. Coverage included Gateway/route deletion, route invalidation, moving one HTTPRoute to another backend, final-owner cleanup, repeated deletion/recreation, endpoint scaling, controller configuration reconstruction after restart, and two controller replicas with direct traffic checks against each. Restart checks establish recovery, not zero downtime during single-replica restart.
The full existing integration suite separately used embedded Gateway API 1.5.0 CRDs, temporary Kubernetes 1.36.2 API servers, and real HAProxy processes in an offline container. Initial harness readiness/cache/API-server networking issues were resolved before the completed runs; they required no additional application changes.
Branch and validation scope
This PR targets the
v1.0maintenance branch and now includes its upstream history through72f2128. The original runtime testing described above was on patched 1.0.7 and 1.0.8, not a newly deployed maintenance-tip image. The current head has additionally passed the pinned revive/staticcheck/betteralign linters, commit-policy checking, gofumpt formatting, gateway package tests with race detection and shuffled order, 100 regression repetitions, and controller compilation locally on Go 1.27. The revised regression test still fails all eight shared-owner cases on unpatched72f2128, while the four final-owner cases pass. All 12 cases pass with the patch.The CI correction replaces nested test-case loops with an explicit 12-case table and checks the manager type assertion and updated-backend presence. The backend ownership fix is unchanged. Please advise on forward-porting to
dev, which has not been validated here.The additional local traffic harnesses/logs are not committed in this PR. The committed regression test is reproducible with:
POD_IP=127.0.0.1 POD_NAMESPACE=test POD_NAME=test go test ./k8s/gate/haproxy -run TestSharedBackendRouteRemoval -count=1These are finite local tests, not a production guarantee, long-duration load test, full conformance run, or architecture matrix. No production deployment was changed; the disposable cluster has been removed. No official fixed release is claimed.