include name match in mischeduled check in daemonset controller
This commit is contained in:
@@ -445,7 +445,10 @@ func (dsc *DaemonSetsController) updateDaemonSetStatus(ds *experimental.DaemonSe
|
|||||||
var desiredNumberScheduled, currentNumberScheduled, numberMisscheduled int
|
var desiredNumberScheduled, currentNumberScheduled, numberMisscheduled int
|
||||||
for _, node := range nodeList.Items {
|
for _, node := range nodeList.Items {
|
||||||
nodeSelector := labels.Set(ds.Spec.Template.Spec.NodeSelector).AsSelector()
|
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])
|
numDaemonPods := len(nodeToDaemonPods[node.Name])
|
||||||
|
|
||||||
if numDaemonPods > 0 {
|
if numDaemonPods > 0 {
|
||||||
|
Reference in New Issue
Block a user