mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
Merge pull request #366 from lixiang233/podAntiAffinity_add_missing_validation
Add missing validation in PodAntiAffinity
This commit is contained in:
@@ -46,6 +46,10 @@ func validateRemovePodsViolatingInterPodAntiAffinityParams(params *api.StrategyP
|
|||||||
|
|
||||||
// RemovePodsViolatingInterPodAntiAffinity evicts pods on the node which are having a pod affinity rules.
|
// RemovePodsViolatingInterPodAntiAffinity evicts pods on the node which are having a pod affinity rules.
|
||||||
func RemovePodsViolatingInterPodAntiAffinity(ctx context.Context, client clientset.Interface, strategy api.DeschedulerStrategy, nodes []*v1.Node, podEvictor *evictions.PodEvictor) {
|
func RemovePodsViolatingInterPodAntiAffinity(ctx context.Context, client clientset.Interface, strategy api.DeschedulerStrategy, nodes []*v1.Node, podEvictor *evictions.PodEvictor) {
|
||||||
|
if err := validateRemovePodsViolatingInterPodAntiAffinityParams(strategy.Params); err != nil {
|
||||||
|
klog.V(1).Info(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
var namespaces api.Namespaces
|
var namespaces api.Namespaces
|
||||||
if strategy.Params != nil {
|
if strategy.Params != nil {
|
||||||
namespaces = strategy.Params.Namespaces
|
namespaces = strategy.Params.Namespaces
|
||||||
|
|||||||
Reference in New Issue
Block a user