Skip to content

Commit

Permalink
Fix update strategy calculation for DaemonSet
Browse files Browse the repository at this point in the history
  • Loading branch information
FillZpp committed Aug 26, 2020
1 parent 447f902 commit dacfbcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/daemonset/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,9 @@ func (dsc *ReconcileDaemonSet) filterDaemonPodsNodeToUpdate(ds *appsv1alpha1.Dae
} else {
sorted = append(updated, rest...)
}
if maxUpdate := len(allNames) - int(partition); maxUpdate < len(sorted) {
if maxUpdate := len(allNames) - int(partition); maxUpdate <= 0 {
return nil, nil
} else if maxUpdate < len(sorted) {
sorted = sorted[:maxUpdate]
}
return sorted, nil
Expand Down

0 comments on commit dacfbcd

Please sign in to comment.