Skip to content

Commit

Permalink
e2e: return the right ctx.Err on failed wait
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Apr 25, 2024
1 parent 1bae0bb commit be8f2a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions e2e/internal/kubeclient/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,21 @@ func (c *Kubeclient) WaitForDeployment(ctx context.Context, namespace, name stri
if ctx.Err() != context.DeadlineExceeded {
return ctx.Err()
}
ctxErr := ctx.Err()
// Fetch and print debug information.
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
pods, err := c.PodsFromDeployment(ctx, namespace, name) //nolint:contextcheck // The parent context expired.
if err != nil {
logger.Error("could not fetch pods for deployment", "name", name, "error", err)
return ctx.Err()
return ctxErr
}
for _, pod := range pods {
if !isPodReady(&pod) {
logger.Debug("pod not ready", "name", pod.Name, "status", c.toJSON(pod.Status))
}
}
return ctx.Err()
return ctxErr
}
}
}
Expand Down

0 comments on commit be8f2a8

Please sign in to comment.