From d601bfa1bbd08653aa86f153e3af08697324d511 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Tue, 6 Oct 2015 16:54:53 -0700 Subject: [PATCH] fix bug in daemonset --- pkg/controller/daemon/controller.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/controller/daemon/controller.go b/pkg/controller/daemon/controller.go index b4fb9e7f2f8..d731f2dcc50 100644 --- a/pkg/controller/daemon/controller.go +++ b/pkg/controller/daemon/controller.go @@ -448,13 +448,18 @@ func (dsc *DaemonSetsController) updateDaemonSetStatus(ds *experimental.DaemonSe shouldRun := nodeSelector.Matches(labels.Set(node.Labels)) numDaemonPods := len(nodeToDaemonPods[node.Name]) - if numDaemonPods > 0 { + // TODO(mikedanese): this does not count nodes that should be running + // exactly one daemon pod but are running more than one daemon pods. + + if shouldRun && numDaemonPods == 1 { currentNumberScheduled++ } if shouldRun { desiredNumberScheduled++ - } else if numDaemonPods >= 0 { + } + + if !shouldRun && numDaemonPods > 0 { numberMisscheduled++ } }