-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
refactor: remove configurator in scheduler #108790
refactor: remove configurator in scheduler #108790
Conversation
Skipping CI for Draft Pull Request. |
@kerthcet: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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/test-infra repository. |
/ok-to-test |
frameworkruntime.WithClientSet(client), | ||
frameworkruntime.WithKubeConfig(options.kubeConfig), | ||
frameworkruntime.WithInformerFactory(informerFactory), | ||
frameworkruntime.WithSnapshotSharedLister(snapshot), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove frameworkruntime.WithRunAllFilters(c.alwaysCheckAllPredicates)
here as c.alwaysCheckAllPredicates
is always false now. I also create a issue #108770 to discuss about whether we should remove this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we can remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you cleanup WithRunAllFilters
and runAllFilters
from the framework too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still be discussed in issue #108770 , if we come to an agreement, I'll create another pr to follow this.
/retest |
2 similar comments
/retest |
/retest |
/cc @ahg-g |
pkg/scheduler/factory.go
Outdated
c.nodeInfoSnapshot, | ||
c.percentageOfNodesToScore) | ||
return sched, nil | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally would like to keep it as more clearly to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the confusion that you try to clear? it is not typical to explicitly return at the end of a function that returns nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, you have named return variables. So the best practice is not to use named variables on long functions, can you please explicitly define them in the function and in the return statements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used to follow the practice: The names are not mandatory but they can make code shorter and clearer: they're documentation
in https://go.dev/doc/effective_go#named-results.
Updated then.
frameworkruntime.WithClientSet(client), | ||
frameworkruntime.WithKubeConfig(options.kubeConfig), | ||
frameworkruntime.WithInformerFactory(informerFactory), | ||
frameworkruntime.WithSnapshotSharedLister(snapshot), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we can remove it
/retest |
thanks, can you please squash. |
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
76ff537
to
1cf535f
Compare
squashed. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, kerthcet 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 |
another followup is to re-organize the code as follows:
With this, scheduler.go would be the file the includes the instantiation logic, while schedule_one.go includes the scheduling logic. |
Signed-off-by: kerthcet kerthcet@gmail.com
What type of PR is this?
/kind cleanup
/sig scheduling
What this PR does / why we need it:
Which issue(s) this PR fixes:
Part 1 of #108788
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: