mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-04 12:10:20 +00:00
e2e: wait for deployment before scale down/up
The scale down/up functions fail often with "deployment not found"
errors. Possibly deploying with Podman is slower than deploying in a
minikube VM, and there is a delay for the deployment to become
available.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
(cherry picked from commit 8f915576c4
)
This commit is contained in:
parent
9d2d7da944
commit
5635e498c0
@ -124,6 +124,9 @@ func waitForDeploymentInAvailableState(clientSet kubernetes.Interface, name, ns
|
|||||||
if isRetryableAPIError(err) {
|
if isRetryableAPIError(err) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
if apierrs.IsNotFound(err) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
e2elog.Logf("%q deployment to be Available (%d seconds elapsed)", name, int(time.Since(start).Seconds()))
|
e2elog.Logf("%q deployment to be Available (%d seconds elapsed)", name, int(time.Since(start).Seconds()))
|
||||||
|
|
||||||
return false, err
|
return false, err
|
||||||
@ -390,6 +393,12 @@ func waitForContainersArgsUpdate(
|
|||||||
) error {
|
) error {
|
||||||
e2elog.Logf("waiting for deployment updates %s/%s", ns, deploymentName)
|
e2elog.Logf("waiting for deployment updates %s/%s", ns, deploymentName)
|
||||||
|
|
||||||
|
// wait for the deployment to be available
|
||||||
|
err := waitForDeploymentInAvailableState(c, deploymentName, ns, deployTimeout)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("deployment %s/%s did not become available yet: %w", ns, deploymentName, err)
|
||||||
|
}
|
||||||
|
|
||||||
// Scale down to 0.
|
// Scale down to 0.
|
||||||
scale, err := c.AppsV1().Deployments(ns).GetScale(context.TODO(), deploymentName, metav1.GetOptions{})
|
scale, err := c.AppsV1().Deployments(ns).GetScale(context.TODO(), deploymentName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user