AlinsRan opened a new pull request, #2906:
URL: https://github.com/apache/apisix-ingress-controller/pull/2906

   ### Type of change:
   
   - [x] Bugfix
   - [x] Documentation
   - [x] CI/CD or Tests
   
   ### What this PR does / why we need it:
   
   APISIX synchronization currently sends no ownership selector to ADC. An 
externally created Service and its routes therefore enter the reconciliation 
diff and can be deleted because they are absent from the controller's desired 
configuration.
   
   Add `manager-by: apisix-ingress-controller` to the selector at the 
provider's shared push entry point for the `apisix` backend. This covers 
event-driven and periodic synchronization as well as empty-configuration 
cleanup when a Gateway or IngressClass is deleted. Preserve existing selector 
constraints without mutating the caller's map. Standalone synchronization is 
unchanged.
   
   Related to #2795. This addresses ownership-based reconciliation rather than 
excluding resource types from synchronization.
   
   Document the boundaries: ADC does not label-filter global rules or plugin 
metadata; nested routes follow their Service's ownership; the shared manager 
label does not isolate separate controller installations. Matching-ID legacy 
resources can be updated and labeled, while unlabeled orphans require an 
ownership review before cleanup.
   
   Validation:
   
   - Confirmed new selector and Gateway cleanup assertions fail before the fix.
   - `go test -race ./internal/provider/apisix ./internal/adc/...` passed.
   - `go test ./test/e2e/apisix -run '^$'` passed (compile check only).
   - Added an e2e case that creates an external Service/Route via Admin API, 
reconciles an Ingress, updates it, then deletes its IngressClass and checks the 
external route survives. The Kubernetes e2e case was not executed locally 
because no active Kubernetes context was available.
   - Manually exercised ADC 0.31.0 `/sync` against APISIX 3.19.0 and etcd 3.5 
in isolated Docker containers: scoped create/update/empty cleanup preserves an 
external Service/Route; a matching-ID unlabeled route is updated and labeled. 
An unscoped control deletes the external route (and reports a separate 404 when 
deleting the Service's nonexistent same-ID upstream).
   
   ### Pre-submission checklist:
   
   - [x] Did you explain what problem does this PR solve? Or what new features 
have been added?
   - [x] Have you added corresponding test cases?
   - [x] Have you modified the corresponding document?
   - [x] Is this PR backward compatible? Existing labeled resources remain 
reconciled; externally owned resources are preserved. Legacy unlabeled orphan 
cleanup is documented above.
   


-- 
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]

Reply via email to