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

   <!-- Please answer these questions before submitting a pull request -->
   
   ### Type of change:
   
   <!-- Please delete options that are not relevant. -->
   
   <!-- Select all the options from below that matches the type your PR best -->
   
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   - [ ] Documentation
   - [x] Refactor
   - [ ] Chore
   - [ ] CI/CD or Tests
   
   ### What this PR does / why we need it:
   
   `internal/adc/client.Client` used to own and expose AIC's own bookkeeping — 
which Kubernetes resource maps to which GatewayProxy config (`ConfigManager`), 
and each GatewayProxy's merged, translated resource snapshot (`cache.Store`) — 
even though neither has anything to do with talking to ADC. This blurred the 
boundary between "AIC's own state" and "the ADC wire client": some callers went 
through `Client`'s own methods, others reached straight into its public fields; 
a GatewayProxy's own config registration didn't fit the shared 
`Task`/store-bundled shape at all and had to route around it; and the whole 
thing carried a completely unused method (`Client.Update`) plus a couple of 
dead/duplicate `ConfigManager` methods.
   
   This PR draws that boundary properly:
   
   - `Client` is now a pure ADC-talking module: it accepts a fully-prepared 
`SyncInput`/`Task` (a GatewayProxy's config plus its already-translated 
resources, labels, and resource types) and returns parsed, typed errors — never 
a raw HTTP status or body. It holds no AIC-side state anymore, and never 
reaches back into the caller to gather anything itself.
   - `apisixProvider` now owns `ConfigManager` and `cache.Store` directly, 
fully private, reached only through their own predefined methods. It builds 
this round's full GatewayProxy config set and each one's sync input itself, and 
hands the whole batch to `Client.Sync` in one call.
   - Removed a chain of code left over from when this shelled out to an `adc` 
CLI binary: `Client` no longer serializes resources into CLI-style string args, 
writes them to a temp file, and has the HTTP executor immediately parse the 
args back apart and re-read the file off disk. Everything now flows in-memory 
end to end. The now-meaningless `apisix_ingress_file_io_duration_seconds` 
metric was retired along with it.
   - Deleted dead API surface picked up along the way: `Client.Update` (never 
called anywhere in the repo), `ConfigManager.Set`/`GetConfigRefs` (unused 
duplicates).
   - `Client` no longer needs a lock guarding cross-call state beyond the one 
it already had for baseline-rebuild tracking — there's no more shared AIC state 
inside it left to protect.
   
   No functional or behavioral change is intended; this is a pure internal 
restructuring.
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the 
review
   -->
   
   - [x] Did you explain what problem does this PR solve? Or what new features 
have been added?
   - [ ] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [x] Is this PR backward compatible? **If it is not backward compatible, 
please discuss on the [mailing 
list](https://github.com/apache/apisix-ingress-controller#community) first**
   


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