Commit 7ca9ec79 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #51081 from diegs/typo

Automatic merge from submit-queue (batch tested with PRs 51081, 52725). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. daemon_controller: fix typo. **What this PR does / why we need it**: I found a small typo while implementing #48841. With the existing code, some edge cases might lead to the wrong pods being deleted. **Release note**: ```release-note NONE ```
parents a238fbd2 9baaeba4
...@@ -855,7 +855,7 @@ func (dsc *DaemonSetsController) manage(ds *extensions.DaemonSet, hash string) e ...@@ -855,7 +855,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