code clean up
This commit is contained in:
parent
3987c8ad91
commit
fba637c33d
@ -1130,7 +1130,10 @@ func (dsc *DaemonSetsController) updateDaemonSetStatus(ctx context.Context, ds *
|
||||
|
||||
if shouldRun {
|
||||
desiredNumberScheduled++
|
||||
if scheduled {
|
||||
if !scheduled {
|
||||
continue
|
||||
}
|
||||
|
||||
currentNumberScheduled++
|
||||
// Sort the daemon pods by creation time, so that the oldest is first.
|
||||
daemonPods, _ := nodeToDaemonPods[node.Name]
|
||||
@ -1151,7 +1154,6 @@ func (dsc *DaemonSetsController) updateDaemonSetStatus(ctx context.Context, ds *
|
||||
if util.IsPodUpdated(pod, hash, generation) {
|
||||
updatedNumberScheduled++
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if scheduled {
|
||||
numberMisscheduled++
|
||||
@ -1351,14 +1353,17 @@ func getUnscheduledPodsWithoutNode(runningNodesList []*v1.Node, nodeToDaemonPods
|
||||
for _, node := range runningNodesList {
|
||||
isNodeRunning[node.Name] = true
|
||||
}
|
||||
|
||||
for n, pods := range nodeToDaemonPods {
|
||||
if !isNodeRunning[n] {
|
||||
if isNodeRunning[n] {
|
||||
continue
|
||||
}
|
||||
for _, pod := range pods {
|
||||
if len(pod.Spec.NodeName) == 0 {
|
||||
results = append(results, pod.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user