Skip to content

Commit

Permalink
fix bug: allow optional filed max unavilable in ads, and set default …
Browse files Browse the repository at this point in the history
…value as 1

Signed-off-by: ABNER-1 <abner199709@gmail.com>
Signed-off-by: yuanyuxing <yuanyuxing@bilibili.com>
  • Loading branch information
yuanyuxing committed Jun 27, 2022
1 parent 345c292 commit 45c8ce2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller/daemonset/daemonset_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ func unavailableCount(ds *appsv1alpha1.DaemonSet, numberToSchedule int) (int, er
}
r := ds.Spec.UpdateStrategy.RollingUpdate
if r == nil {
return 0, nil
return 1, nil
}
if r.MaxUnavailable == nil {
return 1, nil
}
return intstrutil.GetScaledValueFromIntOrPercent(r.MaxUnavailable, numberToSchedule, true)
}
Expand Down

0 comments on commit 45c8ce2

Please sign in to comment.