Skip to content

Commit

Permalink
e2e: wait for deployment before scale down/up
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
nixpanic committed Oct 12, 2022
1 parent cf93ba0 commit 8785652
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions e2e/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ func waitForContainersArgsUpdate(
) error {
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, err := c.AppsV1().Deployments(ns).GetScale(context.TODO(), deploymentName, metav1.GetOptions{})
if err != nil {
Expand Down

0 comments on commit 8785652

Please sign in to comment.