Merge pull request #11439 from phoenixsqf/main

use intstr.GetScaledValueFromIntOrPercent instead of the deprecated
pull/11487/head
Matt Farina 2 years ago committed by GitHub
commit 774c6ce703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -291,7 +291,7 @@ func (c *ReadyChecker) daemonSetReady(ds *appsv1.DaemonSet) bool {
c.log("DaemonSet is not ready: %s/%s. %d out of %d expected pods have been scheduled", ds.Namespace, ds.Name, ds.Status.UpdatedNumberScheduled, ds.Status.DesiredNumberScheduled) c.log("DaemonSet is not ready: %s/%s. %d out of %d expected pods have been scheduled", ds.Namespace, ds.Name, ds.Status.UpdatedNumberScheduled, ds.Status.DesiredNumberScheduled)
return false return false
} }
maxUnavailable, err := intstr.GetValueFromIntOrPercent(ds.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable, int(ds.Status.DesiredNumberScheduled), true) maxUnavailable, err := intstr.GetScaledValueFromIntOrPercent(ds.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable, int(ds.Status.DesiredNumberScheduled), true)
if err != nil { if err != nil {
// If for some reason the value is invalid, set max unavailable to the // If for some reason the value is invalid, set max unavailable to the
// number of desired replicas. This is the same behavior as the // number of desired replicas. This is the same behavior as the

Loading…
Cancel
Save