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
|
@abdelrahman882: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| // 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.
|
|
||
| // Updater updates the passed buffers via API server call and returns the | ||
| // successfully updated buffers and list of errors | ||
| type Updater interface { |
There was a problem hiding this comment.
Since the package has a generic name updater this would end up with updater.Updater in the code losing any connection to buffers. Therefore I would consider making it a BufferUpdater instead.
|
Note that some tests are failing. I have seen these failing on other PRs as well though (example: #9315) |
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.: