-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Move Factory Package to Scheduler #83573
Move Factory Package to Scheduler #83573
Conversation
/cc @alculquicondor |
pkg/scheduler/algorithm_factory.go
Outdated
// Copy returns a snapshot of current registered predicates and priorities. | ||
func Copy() *Snapshot { | ||
// CopyRegisteredPredicatesAndPriorities returns a snapshot of current registered predicates and priorities. | ||
func CopyRegisteredPredicatesAndPriorities() *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.
RegisteredPredicatesAndPrioritiesSnapshot
@@ -61,32 +61,32 @@ func defaultPredicates() sets.String { | |||
// when this function is called, and should be called in tests which may modify the value | |||
// of a feature gate temporarily. | |||
func ApplyFeatureGates() (restore func()) { | |||
snapshot := factory.Copy() | |||
snapshot := scheduler.CopyRegisteredPredicatesAndPriorities() |
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.
Could be in this PR or a follow up:
scheduler.PredicatesAndPrioritiesSnapshot
, which returns the restore function already. I don't see any need to export 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.
Could be in a follow up PR as it's part of the next step
Unexport all functions and types that are only used from pkg/scheduler. There seem to be some unused functions already. So we can remove them here.
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.
sg
@@ -338,7 +337,7 @@ func initPolicyFromConfigMap(client clientset.Interface, policyRef *kubeschedule | |||
} | |||
|
|||
// NewFromConfig returns a new scheduler using the provided Config. | |||
func NewFromConfig(config *factory.Config) *Scheduler { | |||
func NewFromConfig(config *Config) *Scheduler { |
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 this be unexported already?
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.
the only blocker now is the call in cluster-autoscaler.
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.
Since they are locked to an old version, and we already have an alternative for when they decide to upgrade, I would say this is not a blocker.
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.
Okay, could be addressed in a separate PR. WDYT?
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.
sg
There seem to be legitimate failing tests |
@alculquicondor Is there any action that should be taken regarding the following in |
You can squash now |
I'm not sure. You can ask the OWNERS of the folder. @draveness ? |
2937973
to
ab0ebdf
Compare
/retest |
/test pull-kubernetes-e2e-gce-100-performance |
3939f0c
to
0c181ef
Compare
@ahg-g could we merge this soon? It needs a rebase whenever a PR is merged because of moving the factory package which is usually touched in other PRs. |
sure, I thought you were waiting for an answer to this: #83573 (comment) |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, ahmad-diaa 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 |
I don't know, I think this could be addressed later anyway. WDYT? |
/retest |
/test pull-kubernetes-e2e-gce |
/retest Review the full test history for this PR. Silence the bot with an |
6 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
0c181ef
to
4448a1c
Compare
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
…ckage Move Factory Package to Scheduler
What type of PR is this?
/kind cleanup
/sig scheduling
What this PR does / why we need it:
This PR moves the
factory
package to scheduler. This simplifies the process of getting rid offactory.Config
Which issue(s) this PR fixes:
Part of #72547
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: