mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 06:29:29 +01:00
update deprecated sets.String to generic sets
This commit is contained in:
@@ -113,10 +113,10 @@ func (d *RemovePodsViolatingTopologySpreadConstraint) Balance(ctx context.Contex
|
||||
}
|
||||
klog.V(1).InfoS("Processing namespaces for topology spread constraints")
|
||||
podsForEviction := make(map[*v1.Pod]struct{})
|
||||
var includedNamespaces, excludedNamespaces sets.String
|
||||
var includedNamespaces, excludedNamespaces sets.Set[string]
|
||||
if d.args.Namespaces != nil {
|
||||
includedNamespaces = sets.NewString(d.args.Namespaces.Include...)
|
||||
excludedNamespaces = sets.NewString(d.args.Namespaces.Exclude...)
|
||||
includedNamespaces = sets.New(d.args.Namespaces.Include...)
|
||||
excludedNamespaces = sets.New(d.args.Namespaces.Exclude...)
|
||||
}
|
||||
|
||||
// 1. for each namespace...
|
||||
|
||||
@@ -1215,12 +1215,12 @@ func TestTopologySpreadConstraint(t *testing.T) {
|
||||
}
|
||||
|
||||
if tc.expectedEvictedPods != nil {
|
||||
diff := sets.NewString(tc.expectedEvictedPods...).Difference(sets.NewString(evictedPods...))
|
||||
diff := sets.New(tc.expectedEvictedPods...).Difference(sets.New(evictedPods...))
|
||||
if diff.Len() > 0 {
|
||||
t.Errorf(
|
||||
"Expected pods %v to be evicted but %v were not evicted. Actual pods evicted: %v",
|
||||
tc.expectedEvictedPods,
|
||||
diff.List(),
|
||||
diff.UnsortedList(),
|
||||
evictedPods,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user