Skip to content

Commit

Permalink
Fixed pod readiness check
Browse files Browse the repository at this point in the history
Detect also if pod did not exited prematurely.

Signed-off-by: Matej Vašek <[email protected]>
  • Loading branch information
matejvasek committed Jan 23, 2025
1 parent 20a173a commit 079db29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/k8s/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ func podReady(ctx context.Context, core v1.CoreV1Interface, podName, namespace s
d <- nil
return
}
if status.State.Terminated != nil {
msg, _ := GetPodLogs(ctx, namespace, podName, podName)
d <- fmt.Errorf("pod prematurely exited (output: %q, exitcode: %d)", msg, status.State.Terminated.ExitCode)
return
}
if status.State.Waiting != nil {
switch status.State.Waiting.Reason {
case "ErrImagePull",
Expand Down

0 comments on commit 079db29

Please sign in to comment.