nic-6443 opened a new pull request, #2743: URL: https://github.com/apache/apisix-ingress-controller/pull/2743
## Problem The translator sets `hosts` on both Route and Service for ApisixRoute resources. Since APISIX routes inherit hosts from their parent service, the route-level hosts is redundant. For backends that don't support route-level hosts, this causes a false diff every sync cycle: the local state has `route.hosts` but the remote state never does, triggering unnecessary PUT requests and audit log bloat. ## Root Cause In `buildRoute()` (`internal/adc/translator/apisixroute.go`), `route.Hosts` was set to `rule.Match.Hosts`. However, `buildService()` already sets `service.Hosts` to the same value. Since routes inherit hosts from their parent service, the route-level hosts is redundant and can cause false diffs during config sync. ## Fix Remove `route.Hosts = rule.Match.Hosts` from `buildRoute()`. `service.Hosts` remains as the canonical location for host matching. ## Testing Added unit tests: - `TestBuildRoute_HostsNotSet`: verifies route.Hosts is not set after buildRoute - `TestBuildService_HostsSet`: verifies service.Hosts is correctly set -- 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]
