Skip to content

Add Capacity buffers updater interface to allow wrapping updating logic#9348

Open
abdelrahman882 wants to merge 1 commit intokubernetes:masterfrom
abdelrahman882:updaterInterface
Open

Add Capacity buffers updater interface to allow wrapping updating logic#9348
abdelrahman882 wants to merge 1 commit intokubernetes:masterfrom
abdelrahman882:updaterInterface

Conversation

@abdelrahman882
Copy link
Contributor

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?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/needs-area area/cluster-autoscaler labels Mar 12, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: abdelrahman882
Once this PR has been reviewed and has the lgtm label, please assign aleksandra-malinowska for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-area labels Mar 12, 2026
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 12, 2026
// 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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jbtk
Copy link
Member

jbtk commented Mar 12, 2026

Note that some tests are failing. I have seen these failing on other PRs as well though (example: #9315)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants