mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Merge pull request #121141 from wlq1212/introduceNewethod
using wait.Interrupted instead of deprecated wait.ErrWaitTimeout for utils
This commit is contained in:
commit
2fb99eb9e8
@ -105,7 +105,7 @@ func waitForDeploymentCompleteMaybeCheckRolling(c clientset.Interface, d *apps.D
|
|||||||
return false, nil
|
return false, nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if err == wait.ErrWaitTimeout {
|
if wait.Interrupted(err) {
|
||||||
err = fmt.Errorf("%s", reason)
|
err = fmt.Errorf("%s", reason)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -224,7 +224,7 @@ func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName
|
|||||||
}
|
}
|
||||||
return true, nil
|
return true, nil
|
||||||
})
|
})
|
||||||
if err == wait.ErrWaitTimeout {
|
if wait.Interrupted(err) {
|
||||||
LogReplicaSetsOfDeployment(deployment, nil, newRS, logf)
|
LogReplicaSetsOfDeployment(deployment, nil, newRS, logf)
|
||||||
err = fmt.Errorf(reason)
|
err = fmt.Errorf(reason)
|
||||||
}
|
}
|
||||||
@ -316,7 +316,7 @@ func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string,
|
|||||||
updateErr = err
|
updateErr = err
|
||||||
return false, nil
|
return false, nil
|
||||||
})
|
})
|
||||||
if pollErr == wait.ErrWaitTimeout {
|
if wait.Interrupted(pollErr) {
|
||||||
pollErr = fmt.Errorf("couldn't apply the provided updated to deployment %q: %v", name, updateErr)
|
pollErr = fmt.Errorf("couldn't apply the provided updated to deployment %q: %v", name, updateErr)
|
||||||
}
|
}
|
||||||
return deployment, pollErr
|
return deployment, pollErr
|
||||||
@ -375,7 +375,7 @@ func WaitForDeploymentWithCondition(c clientset.Interface, ns, deploymentName, r
|
|||||||
cond := deploymentutil.GetDeploymentCondition(deployment.Status, condType)
|
cond := deploymentutil.GetDeploymentCondition(deployment.Status, condType)
|
||||||
return cond != nil && cond.Reason == reason, nil
|
return cond != nil && cond.Reason == reason, nil
|
||||||
})
|
})
|
||||||
if pollErr == wait.ErrWaitTimeout {
|
if wait.Interrupted(pollErr) {
|
||||||
pollErr = fmt.Errorf("deployment %q never updated with the desired condition and reason, latest deployment conditions: %+v", deployment.Name, deployment.Status.Conditions)
|
pollErr = fmt.Errorf("deployment %q never updated with the desired condition and reason, latest deployment conditions: %+v", deployment.Name, deployment.Status.Conditions)
|
||||||
_, allOldRSs, newRS, err := GetAllReplicaSets(deployment, c)
|
_, allOldRSs, newRS, err := GetAllReplicaSets(deployment, c)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -47,7 +47,7 @@ func UpdateReplicaSetWithRetries(c clientset.Interface, namespace, name string,
|
|||||||
updateErr = err
|
updateErr = err
|
||||||
return false, nil
|
return false, nil
|
||||||
})
|
})
|
||||||
if pollErr == wait.ErrWaitTimeout {
|
if wait.Interrupted(pollErr) {
|
||||||
pollErr = fmt.Errorf("couldn't apply the provided updated to replicaset %q: %v", name, updateErr)
|
pollErr = fmt.Errorf("couldn't apply the provided updated to replicaset %q: %v", name, updateErr)
|
||||||
}
|
}
|
||||||
return rs, pollErr
|
return rs, pollErr
|
||||||
@ -85,7 +85,7 @@ func UpdateReplicaSetStatusWithRetries(c clientset.Interface, namespace, name st
|
|||||||
updateErr = err
|
updateErr = err
|
||||||
return false, nil
|
return false, nil
|
||||||
})
|
})
|
||||||
if pollErr == wait.ErrWaitTimeout {
|
if wait.Interrupted(pollErr) {
|
||||||
pollErr = fmt.Errorf("couldn't apply the provided update to replicaset %q: %v", name, updateErr)
|
pollErr = fmt.Errorf("couldn't apply the provided update to replicaset %q: %v", name, updateErr)
|
||||||
}
|
}
|
||||||
return rs, pollErr
|
return rs, pollErr
|
||||||
|
Loading…
Reference in New Issue
Block a user