From 1766af60685898b91a4a2d044b89c5ded2c85191 Mon Sep 17 00:00:00 2001 From: NickrenREN Date: Fri, 9 Jun 2017 14:07:28 +0800 Subject: [PATCH] Fix mismatched types Verbose and bool Fix invalid operation: mismatched types Verbose and bool --- .../pkg/scheduler/algorithm/predicates/predicates.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugin/pkg/scheduler/algorithm/predicates/predicates.go b/plugin/pkg/scheduler/algorithm/predicates/predicates.go index 95939bf5043..5ee83f916b0 100644 --- a/plugin/pkg/scheduler/algorithm/predicates/predicates.go +++ b/plugin/pkg/scheduler/algorithm/predicates/predicates.go @@ -621,11 +621,13 @@ func PodFitsResources(pod *v1.Pod, meta interface{}, nodeInfo *schedulercache.No } } - if glog.V(10) && len(predicateFails) == 0 { - // We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is - // not logged. There is visible performance gain from it. - glog.Infof("Schedule Pod %+v on Node %+v is allowed, Node is running only %v out of %v Pods.", - podName(pod), node.Name, len(nodeInfo.Pods()), allowedPodNumber) + if glog.V(10) { + if len(predicateFails) == 0 { + // We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is + // not logged. There is visible performance gain from it. + glog.Infof("Schedule Pod %+v on Node %+v is allowed, Node is running only %v out of %v Pods.", + podName(pod), node.Name, len(nodeInfo.Pods()), allowedPodNumber) + } } return len(predicateFails) == 0, predicateFails, nil }