daemon_controller: fix typo.

With the existing code, some edge cases might lead to the wrong pods being deleted.
parent bf001900
...@@ -854,7 +854,7 @@ func (dsc *DaemonSetsController) manage(ds *extensions.DaemonSet, hash string) e ...@@ -854,7 +854,7 @@ func (dsc *DaemonSetsController) manage(ds *extensions.DaemonSet, hash string) e
if len(daemonPodsRunning) > 1 { if len(daemonPodsRunning) > 1 {
sort.Sort(podByCreationTimestamp(daemonPodsRunning)) sort.Sort(podByCreationTimestamp(daemonPodsRunning))
for i := 1; i < len(daemonPodsRunning); i++ { for i := 1; i < len(daemonPodsRunning); i++ {
podsToDelete = append(podsToDelete, daemonPods[i].Name) podsToDelete = append(podsToDelete, daemonPodsRunning[i].Name)
} }
} }
case !shouldContinueRunning && exists: case !shouldContinueRunning && exists:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment