Repository navigation
controller: notify gateways after GatewayConfig deletion - #2877
Open
spicysharkco wants to merge 1 commit into
Open
spicysharkco wants to merge 1 commit into
spicysharkco wants to merge 1 commit into
Conversation
Notify referencing Gateways when the config is no longer present so they can reconcile with defaults. Preserve list errors for retry. Signed-off-by: Leo King <321699413+spicysharkco@users.noreply.github.com>
✅ Deploy Preview for theagentrouter canceled.
|
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.
Description
Create a
GatewayConfignamedexamplewithspec.extProc.kubernetes.envsettingOTEL_EXPORTER_OTLP_ENDPOINT. Create a Gateway in the same namespace withaigateway.envoyproxy.io/gateway-config: example. Once the setting applies, delete the config without changing the Gateway or its routes. The injected extproc environment keeps the removed setting until another event reconciles the Gateway. Envoy metadata-forwarding and forward-proxy settings can also remain stale.The delete reconcile receives the config's name and namespace, but the NotFound branch returns without notifying referencing Gateways (
internal/controller/gateway_config.go:56). ReusesyncGatewayConfigwith that request identity. The existing index reads the Gateway annotation, so it still finds references after deletion. Gateway reconciliation already falls back to defaults when the config is missing (internal/controller/gateway.go:1585). List errors are returned for retry; the missing config's status is not updated.The deletion test now deletes the object before reconciling its key. Setting only a deletion timestamp left the object readable and missed this path. The missing-config expectation and list-error assertion cover the changed NotFound behavior. A never-created config also notifies current references because the request cannot distinguish it from a deletion.
Related Issues/PRs (if applicable)
Follow-up to #1623, #2427, and #2540. Open and closed PR/issue searches found no competing deletion fix. Open #2710 modernizes syntax in the same test and conflicts with its setup changes.
The same early return exists on
release/v0.5,release/v0.6,release/v0.7,release/v1.0, andrelease/v1.1; this targets main.Special notes for reviewers (if applicable)
Run locally:
With only the production fix reverted: 3 failed, 0 passed. Fixed: 3 passed, 0 failed.
go test -json -count=1 ./internal/controller/...: 3 packages, 273 top-level tests and 540 subtests passed; none failed or skipped.go test -race -json -count=1 ./internal/controller: 232 top-level tests and 469 subtests passed; none failed or skipped.go vet ./internal/controllerpassed.make precommitpassed: 0 lint issues; 2 charts linted, 0 failures.The cache resync is filtered by the generation predicate, so it does not bound recovery. Config recreation notifies Gateways through the existing path. Annotation-only reference edits have a separate existing generation-filtering limitation.
No live-cluster, end-to-end, or release-branch validation. The repository-wide suite was not rerun for this review.