Merge pull request #65948 from figo/stateless
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
Simplify device manager: make endpoint stateless
While reviewing devicemanager code, found the caching layer on endpoint is redundant.
Here are the 3 related objects in picture:
**devicemanager <-> endpoint <-> plugin**
plugin is the source of truth for devices and device health status.
devicemanager maintain healthyDevices, unhealthyDevices, allocatedDevices based on updates
from plugin.
So there is no point for endpoint to cache devices, this patch is removing the cache layer,
endpoint becomes stateless, which i believe should be the case (but i do welcome review
if i missed something here).
also removing the Manager.Devices() since i didn't find any caller of this other than test.
if we need to get all devices from manager in future, it just need to return healthyDevices + unhealthyDevices, so don't have to call endpoint after all.
This patch makes code more readable, data model been simplified.
**What this PR does / why we need it**:
this patch simplify the device manager code, make it more maintainable.
**Which issue(s) this PR fixes** *:
this is a refactor of device manager code
**Special notes for your reviewer**:
will need to rebase the code if #58755 get checked-in first.
**Release note**:
```release-note
None
```
/sig node
/cc @jiayingz @RenaudWasTaken @vishh @saad-ali @vikaschoudhary16 @vladimirvivien @anfernee
Showing
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to comment