Merge pull request #38780 from mikedanese/ds-fix1

Automatic merge from submit-queue

daemonset: bail out after we enqueue once

This isn't terrible because we dedup in the queue but it's a waste of
cycles.
pull/6/head
Kubernetes Submit Queue 2016-12-15 16:15:52 -08:00 committed by GitHub
commit 7ca5f92b58
1 changed files with 2 additions and 0 deletions

View File

@ -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).