Add Capacity buffers updater interface to allow wrapping updating logic#9348
Add Capacity buffers updater interface to allow wrapping updating logic#9348abdelrahman882 wants to merge 1 commit intokubernetes:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: abdelrahman882 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
157c3be to
60e098b
Compare
| // Update updates the buffer status with pod capacity | ||
| func (u *StatusUpdater) Update(buffers []*v1.CapacityBuffer) []error { | ||
| // Update updates the buffer status and returns the updated buffers objects and list of errors | ||
| func (u *StatusUpdater) Update(buffers []*v1.CapacityBuffer) ([]*v1.CapacityBuffer, []error) { |
There was a problem hiding this comment.
Since we are introducing an interface here that others may use maybe it would make sense to also return a list of failed buffers for completeness and not only errors.
There was a problem hiding this comment.
The caller already can get the failed objects (the passed buffers list - the returned ones) and the reason we return the successfully updated buffers is that the successful call returns the newly updated object written to API server while the other object will be redundant.
But I am okay with both approaches if you insist
|
Note that some tests are failing. I have seen these failing on other PRs as well though (example: #9315) |
60e098b to
b684510
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adding Capacity buffers updater interface and use the interface in the controller to allow the injection of different implementations of the updating logic where the current status updater would be the default implementation to be used by the controller
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: