1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

update deprecated sets.String to generic sets

This commit is contained in:
Amir Alavi
2023-05-11 22:35:44 -04:00
parent 8cbbe5501b
commit 359b38a34c
16 changed files with 64 additions and 64 deletions

View File

@@ -50,10 +50,10 @@ func New(args runtime.Object, handle frameworktypes.Handle) (frameworktypes.Plug
return nil, fmt.Errorf("want args to be of type RemovePodsViolatingNodeTaintsArgs, got %T", args)
}
var includedNamespaces, excludedNamespaces sets.String
var includedNamespaces, excludedNamespaces sets.Set[string]
if nodeTaintsArgs.Namespaces != nil {
includedNamespaces = sets.NewString(nodeTaintsArgs.Namespaces.Include...)
excludedNamespaces = sets.NewString(nodeTaintsArgs.Namespaces.Exclude...)
includedNamespaces = sets.New(nodeTaintsArgs.Namespaces.Include...)
excludedNamespaces = sets.New(nodeTaintsArgs.Namespaces.Exclude...)
}
// We can combine Filter and PreEvictionFilter since for this strategy it does not matter where we run PreEvictionFilter
@@ -67,7 +67,7 @@ func New(args runtime.Object, handle frameworktypes.Handle) (frameworktypes.Plug
return nil, fmt.Errorf("error initializing pod filter function: %v", err)
}
excludedTaints := sets.NewString(nodeTaintsArgs.ExcludedTaints...)
excludedTaints := sets.New(nodeTaintsArgs.ExcludedTaints...)
excludeTaint := func(taint *v1.Taint) bool {
// Exclude taints by key *or* key=value
return excludedTaints.Has(taint.Key) || (taint.Value != "" && excludedTaints.Has(fmt.Sprintf("%s=%s", taint.Key, taint.Value)))