Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor refactor to scale-up orchestrator for more re-usability #7649

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

kawych
Copy link
Contributor

@kawych kawych commented Dec 30, 2024

What type of PR is this?

What this PR does / why we need it:

It's a minor refactor that makes it easier to re-use parts of the core scale-up logic while replacing other parts:

  • More methods are made public for re-usability
  • Async initializer is extracted from CreateNodeGroup() function to substitute the initializer easier

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/cluster-autoscaler labels Dec 30, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 30, 2024
@kawych kawych force-pushed the dws-htn branch 2 times, most recently from 79f141d to 86d6ac1 Compare December 30, 2024 14:06
@@ -188,7 +188,8 @@ func (e *scaleUpExecutor) executeScaleUp(
return nil
}

func combineConcurrentScaleUpErrors(errs []errors.AutoscalerError) errors.AutoscalerError {
// CombineConcurrentScaleUpErrors returns combined scale-up error to report after multiple concurrent scale-ups might haver failed.
func CombineConcurrentScaleUpErrors(errs []errors.AutoscalerError) errors.AutoscalerError {
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense as a part of the errors package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 10, 2025
@@ -131,3 +133,63 @@ func (e autoscalerErrorImpl) Type() AutoscalerErrorType {
func (e autoscalerErrorImpl) AddPrefix(msg string, args ...interface{}) AutoscalerError {
return autoscalerErrorImpl{errorType: e.errorType, wrappedErr: e, msg: fmt.Sprintf(msg, args...)}
}

// CombineConcurrentScaleUpErrors returns combined scale-up error to report after multiple concurrent scale-ups might haver failed.
func CombineConcurrentScaleUpErrors(errs []AutoscalerError) AutoscalerError {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think there's anything scale up specific here, can you rename this to just CombineConcurrentErrors? Or even CombineErrors if you also remove the word "concurrent" from line 173?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

Actually, since this is in the errors package now, I'd consider making it an even more concise errors.Combine. Up to you though.

@kawych kawych force-pushed the dws-htn branch 6 times, most recently from a80833c to edd5434 Compare January 15, 2025 16:33
@x13n
Copy link
Member

x13n commented Jan 21, 2025

/lgtm
/approve
/hold

Looks good, left just one last minor comment - feel free to cancel the hold and merge as is if you disagree.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2025
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 21, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kawych, x13n

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

The pull request process is described here

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 21, 2025
@x13n
Copy link
Member

x13n commented Jan 21, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 21, 2025
@x13n
Copy link
Member

x13n commented Jan 21, 2025

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2025
@k8s-ci-robot k8s-ci-robot merged commit abf3e44 into kubernetes:master Jan 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants