use generic sets in scheduler

Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
This commit is contained in:
bzsuni 2023-09-28 21:30:28 +08:00
parent 29ff98ff37
commit 6200eb04af
2 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ func mergePluginSet(logger klog.Logger, defaultPluginSet, customPluginSet v1.Plu
disabledPlugins := sets.New[string]()
enabledCustomPlugins := make(map[string]pluginIndex)
// replacedPluginIndex is a set of index of plugins, which have replaced the default plugins.
replacedPluginIndex := sets.NewInt()
replacedPluginIndex := sets.New[int]()
var disabled []v1.Plugin
for _, disabledPlugin := range customPluginSet.Disabled {
// if the user is manually disabling any (or all, with "*") default plugins for an extension point,

View File

@ -75,7 +75,7 @@ type stateData struct {
//
// Set in parallel during Filter, so write access there must be
// protected by the mutex. Used by PostFilter.
unavailableClaims sets.Int
unavailableClaims sets.Set[int]
// podSchedulingState keeps track of the PodSchedulingContext
// (if one exists) and the changes made to it.
@ -713,7 +713,7 @@ func (pl *dynamicResources) Filter(ctx context.Context, cs *framework.CycleState
state.mutex.Lock()
defer state.mutex.Unlock()
if state.unavailableClaims == nil {
state.unavailableClaims = sets.NewInt()
state.unavailableClaims = sets.New[int]()
}
for index := range unavailableClaims {