Lcos-000 opened a new pull request, #2871: URL: https://github.com/apache/apisix-ingress-controller/pull/2871
### Type of change - [x] Bugfix - [x] CI/CD or Tests ### What this PR does / why we need it This PR fixes stale data-plane resources left behind when a `GatewayProxy` is deleted, becomes invalid, or no longer has any referrers. Previously, these paths could remove only the local ConfigManager entry or return without notifying the Provider. As a result, resources previously synchronized through the GatewayProxy could remain in the ADC Store and APISIX. This change: - Triggers GatewayProxy cleanup when the GatewayProxy is deleted, its provider is cleared or invalid, or it has no remaining referrers; - Removes all resources owned by the GatewayProxy from the local ADC Store; - Sends an empty resource configuration to ADC using the previous GatewayProxy connection details; - Removes the ConfigManager entry only after the ADC synchronization succeeds; - Preserves the configuration when synchronization fails so cleanup can be retried; - Removes stale resource-to-configuration associations and PluginMetadata; - Uses a stable canonical key for GatewayProxy configurations, independent of `TypeMeta`; - Skips inactive GatewayProxy configurations during configuration building. Fixes #2870 ### Tests Added coverage for GatewayProxy deletion and invalidation, cleanup without referrers, cleanup isolation, retry and idempotent behavior, deletion without `TypeMeta`, PluginMetadata cleanup, and inactive GatewayProxy translation. Validation performed: ```text go test -count=1 ./api/... ./internal/... go test -race -count=1 ./internal/provider/apisix ./internal/adc/translator ./internal/controller ./internal/adc/client go vet ./internal/provider/apisix ./internal/adc/translator ./internal/controller ./internal/adc/client go test -count=1 ./test/e2e/gatewayapi -run ^ git diff --check ``` ### Pre-submission checklist - [x] The problem and motivation are explained. - [x] Corresponding test cases have been added. - [x] The change is backward compatible. - [ ] Documentation changes are required. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
