From f758cb418df3e0ddc48be751ceb1cab03fc09fa5 Mon Sep 17 00:00:00 2001 From: Ivan Shvedunov Date: Mon, 22 Aug 2016 20:10:49 +0300 Subject: [PATCH] Fix possible panic in PodAffinityChecker --- plugin/pkg/scheduler/algorithm/predicates/predicates.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pkg/scheduler/algorithm/predicates/predicates.go b/plugin/pkg/scheduler/algorithm/predicates/predicates.go index 5526eff441a..fb88a9bba81 100644 --- a/plugin/pkg/scheduler/algorithm/predicates/predicates.go +++ b/plugin/pkg/scheduler/algorithm/predicates/predicates.go @@ -968,7 +968,7 @@ func (c *PodAffinityChecker) getMatchingAntiAffinityTerms(pod *api.Pod, allPods if err != nil { return nil, err } - if affinity.PodAntiAffinity != nil { + if affinity != nil && affinity.PodAntiAffinity != nil { existingPodNode, err := c.info.GetNodeInfo(existingPod.Spec.NodeName) if err != nil { return nil, err