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:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user