-
Notifications
You must be signed in to change notification settings - Fork 41.1k
chore(scheduler): use framework.Features in scheduler plugins #130414
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
chore(scheduler): use framework.Features in scheduler plugins #130414
Conversation
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-sigs/prow repository. |
@@ -37,6 +36,7 @@ type scorer func(args *config.NodeResourcesFitArgs) *resourceAllocationScorer | |||
// resourceAllocationScorer contains information to calculate resource allocation score. | |||
type resourceAllocationScorer struct { | |||
Name string | |||
fts feature.Features |
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.
Let's create fields for specific features, i.e. enableInPlacePodVerticalScaling
and enablePodLevelResources
. See other plugins for reference
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.
done. and also change other part
52c1ce2
to
94cf0ca
Compare
|
||
// The plugin name should be listed in the CSINode object annotation. | ||
// This indicates that the plugin has been migrated to a CSI driver in the node. | ||
csiNodeAnn := csiNode.GetAnnotations() |
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 part seem to be unreachable code
@@ -1033,7 +1037,7 @@ func (a byPVCSize) Less(i, j int) bool { | |||
} | |||
|
|||
// isCSIMigrationOnForPlugin checks if CSI migration is enabled for a given plugin. | |||
func isCSIMigrationOnForPlugin(pluginName string) bool { | |||
func isCSIMigrationOnForPlugin(enableCSIMigrationPortworx bool, pluginName string) bool { |
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.
Would it better that we adjust the order of args
func isCSIMigrationOnForPlugin(enableCSIMigrationPortworx bool, pluginName string) bool { | |
func isCSIMigrationOnForPlugin(pluginName string, enableCSIMigrationPortworx bool) bool { |
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.
done
94cf0ca
to
9f769f4
Compare
/test pull-kubernetes-integration |
) | ||
|
||
// isCSIMigrationOn returns a boolean value indicating whether | ||
// the CSI migration has been enabled for a particular storage plugin. | ||
func isCSIMigrationOn(csiNode *storagev1.CSINode, pluginName string) bool { | ||
func isCSIMigrationOn(pluginName string, enableCSIMigrationPortworx bool, csiNode *storagev1.CSINode) bool { |
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.
func isCSIMigrationOn(pluginName string, enableCSIMigrationPortworx bool, csiNode *storagev1.CSINode) bool { | |
func isCSIMigrationOn(pluginName string, csiNode *storagev1.CSINode, enableCSIMigrationPortworx bool) bool { |
if !utilfeature.DefaultFeatureGate.Enabled(features.CSIMigrationPortworx) { | ||
return false | ||
} | ||
return enableCSIMigrationPortworx |
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.
Is it a correct change? Previously, if feature gate was enabled, annotations were checked. Was that check unnecessary?
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, I ignored this problem... I also rolled back the delete changes #130414 (comment)
9f769f4
to
a0e500e
Compare
) | ||
|
||
// isCSIMigrationOn returns a boolean value indicating whether | ||
// the CSI migration has been enabled for a particular storage plugin. | ||
func isCSIMigrationOn(csiNode *storagev1.CSINode, pluginName string) bool { | ||
func isCSIMigrationOn(pluginName string, csiNode *storagev1.CSINode, enableCSIMigrationPortworx bool) bool { |
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.
nit: We could even do:
func isCSIMigrationOn(pluginName string, csiNode *storagev1.CSINode, enableCSIMigrationPortworx bool) bool { | |
func isCSIMigrationOn(csiNode *storagev1.CSINode, pluginName string, enableCSIMigrationPortworx bool) bool { |
Not to change the order
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.
done
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.
done
a0e500e
to
239aad8
Compare
/test pull-kubernetes-e2e-gce |
/lgtm |
LGTM label has been added. Git tree hash: a837aa521c5e3de47bcecff552daeb3d10e1a4fc
|
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: googs1025, macsko 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 |
/test pull-kubernetes-e2e-gce |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #130406
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: