From 3a311a2bc2b5be904ca1f13bd3e28152b47c74ec Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Wed, 14 Dec 2016 12:59:04 -0800 Subject: [PATCH] daemonset: bail out after we enqueue once This isn't terrible because we dedup in the queue but it's a waste of cycles. --- pkg/controller/daemon/daemoncontroller.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/controller/daemon/daemoncontroller.go b/pkg/controller/daemon/daemoncontroller.go index b7ebab215dc..097d88b6274 100644 --- a/pkg/controller/daemon/daemoncontroller.go +++ b/pkg/controller/daemon/daemoncontroller.go @@ -385,6 +385,7 @@ func (dsc *DaemonSetsController) addNode(obj interface{}) { shouldEnqueue := dsc.nodeShouldRunDaemonPod(node, ds) if shouldEnqueue { dsc.enqueueDaemonSet(ds) + return } } } @@ -406,6 +407,7 @@ func (dsc *DaemonSetsController) updateNode(old, cur interface{}) { shouldEnqueue := (dsc.nodeShouldRunDaemonPod(oldNode, ds) != dsc.nodeShouldRunDaemonPod(curNode, ds)) if shouldEnqueue { dsc.enqueueDaemonSet(ds) + return } } // TODO: it'd be nice to pass a hint with these enqueues, so that each ds would only examine the added node (unless it has other work to do, too).