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
@k8s-ci-robot
Copy link
Contributor

@abdelrahman882: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-autoscaling-e2e-gci-gce-ca-test 60e098b link false /test pull-autoscaling-e2e-gci-gce-ca-test

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.

Details

Instructions 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) {
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.


// Updater updates the passed buffers via API server call and returns the
// successfully updated buffers and list of errors
type Updater interface {
Copy link
Member

Choose a reason for hiding this comment

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

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.

@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