From 6200eb04aff158a2c8f8dc01d166c0bd05ffae26 Mon Sep 17 00:00:00 2001 From: bzsuni Date: Thu, 28 Sep 2023 21:30:28 +0800 Subject: [PATCH] use generic sets in scheduler Signed-off-by: bzsuni --- pkg/scheduler/apis/config/v1/default_plugins.go | 2 +- .../framework/plugins/dynamicresources/dynamicresources.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/scheduler/apis/config/v1/default_plugins.go b/pkg/scheduler/apis/config/v1/default_plugins.go index 509cb57a274..ded35ef8fa1 100644 --- a/pkg/scheduler/apis/config/v1/default_plugins.go +++ b/pkg/scheduler/apis/config/v1/default_plugins.go @@ -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, diff --git a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go index e090129daaf..7581b66b317 100644 --- a/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go +++ b/pkg/scheduler/framework/plugins/dynamicresources/dynamicresources.go @@ -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 {