mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 14:41:10 +01:00
Merge pull request #88 from aveshagarwal/master-issues
Fix dryRun issue and avoid unnecessary log msg when node affinity strategy is disabled.
This commit is contained in:
@@ -27,8 +27,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func RemovePodsViolatingNodeAffinity(ds *options.DeschedulerServer, strategy api.DeschedulerStrategy, evictionPolicyGroupVersion string, nodes []*v1.Node, nodePodCount nodePodEvictedCount) {
|
func RemovePodsViolatingNodeAffinity(ds *options.DeschedulerServer, strategy api.DeschedulerStrategy, evictionPolicyGroupVersion string, nodes []*v1.Node, nodePodCount nodePodEvictedCount) {
|
||||||
evictionCount := removePodsViolatingNodeAffinityCount(ds, strategy, evictionPolicyGroupVersion, nodes, nodePodCount, ds.MaxNoOfPodsToEvictPerNode)
|
removePodsViolatingNodeAffinityCount(ds, strategy, evictionPolicyGroupVersion, nodes, nodePodCount, ds.MaxNoOfPodsToEvictPerNode)
|
||||||
glog.V(1).Infof("Evicted %v pods", evictionCount)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func removePodsViolatingNodeAffinityCount(ds *options.DeschedulerServer, strategy api.DeschedulerStrategy, evictionPolicyGroupVersion string, nodes []*v1.Node, nodepodCount nodePodEvictedCount, maxPodsToEvict int) int {
|
func removePodsViolatingNodeAffinityCount(ds *options.DeschedulerServer, strategy api.DeschedulerStrategy, evictionPolicyGroupVersion string, nodes []*v1.Node, nodepodCount nodePodEvictedCount, maxPodsToEvict int) int {
|
||||||
@@ -58,7 +57,7 @@ func removePodsViolatingNodeAffinityCount(ds *options.DeschedulerServer, strateg
|
|||||||
|
|
||||||
if !nodeutil.PodFitsCurrentNode(pod, node) && nodeutil.PodFitsAnyNode(pod, nodes) {
|
if !nodeutil.PodFitsCurrentNode(pod, node) && nodeutil.PodFitsAnyNode(pod, nodes) {
|
||||||
glog.V(1).Infof("Evicting pod: %v", pod.Name)
|
glog.V(1).Infof("Evicting pod: %v", pod.Name)
|
||||||
evictions.EvictPod(ds.Client, pod, evictionPolicyGroupVersion, false)
|
evictions.EvictPod(ds.Client, pod, evictionPolicyGroupVersion, ds.DryRun)
|
||||||
nodepodCount[node]++
|
nodepodCount[node]++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,5 +69,6 @@ func removePodsViolatingNodeAffinityCount(ds *options.DeschedulerServer, strateg
|
|||||||
return evictedPodCount
|
return evictedPodCount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
glog.V(1).Infof("Evicted %v pods", evictedPodCount)
|
||||||
return evictedPodCount
|
return evictedPodCount
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user