include name match in mischeduled check in daemonset controller

This commit is contained in:
Mike Danese 2015-10-06 17:01:54 -07:00
parent 57a08b5563
commit 5a441d4ad1

View File

@ -445,7 +445,10 @@ func (dsc *DaemonSetsController) updateDaemonSetStatus(ds *experimental.DaemonSe
var desiredNumberScheduled, currentNumberScheduled, numberMisscheduled int
for _, node := range nodeList.Items {
nodeSelector := labels.Set(ds.Spec.Template.Spec.NodeSelector).AsSelector()
shouldRun := nodeSelector.Matches(labels.Set(node.Labels))
nameMatch := ds.Spec.Template.Name == "" || ds.Spec.Template.Name == node.Name
labelMatch := nodeSelector.Matches(labels.Set(node.Labels))
shouldRun := nameMatch && labelMatch
numDaemonPods := len(nodeToDaemonPods[node.Name])
if numDaemonPods > 0 {