From 144d72ca7b5080b7a377d418bd9ffea4e9113b04 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Fri, 18 Sep 2015 12:19:07 -0700 Subject: [PATCH] fix incorrect log statement in daemon controller --- pkg/controller/daemon/controller.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/controller/daemon/controller.go b/pkg/controller/daemon/controller.go index d0b93427a2a..54b5097bea8 100644 --- a/pkg/controller/daemon/controller.go +++ b/pkg/controller/daemon/controller.go @@ -214,11 +214,13 @@ func (dsc *DaemonSetsController) getPodDaemonSet(pod *api.Pod) *experimental.Dae glog.V(4).Infof("No daemon sets found for pod %v, daemon set controller will avoid syncing", pod.Name) return nil } - // More than two items in this list indicates user error. If two daemon - // sets overlap, sort by creation timestamp, subsort by name, then pick - // the first. - glog.Errorf("user error! more than one daemon is selecting pods with labels: %+v", pod.Labels) - sort.Sort(byCreationTimestamp(sets)) + if len(sets) > 1 { + // More than two items in this list indicates user error. If two daemon + // sets overlap, sort by creation timestamp, subsort by name, then pick + // the first. + glog.Errorf("user error! more than one daemon is selecting pods with labels: %+v", pod.Labels) + sort.Sort(byCreationTimestamp(sets)) + } return &sets[0] }