Skip to content

Commit

Permalink
Update pod status function to return Executor pod logs
Browse files Browse the repository at this point in the history
- The only way an error will arise is if we try to check the Executor pod's logs before or while it's being created. This commit resolves by simply waiting for the pod to be created.
  • Loading branch information
lbeckman314 committed Feb 5, 2025
1 parent 42d8ae1 commit cc25140
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions worker/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,7 @@ func waitForPodRunning(ctx context.Context, namespace string, podName string, ti
return nil, fmt.Errorf("getting pod %s: %v", podName, err)
}

// Check if pod is in a terminal state
if pod.Status.Phase == corev1.PodRunning {
return pod, nil
} else if pod.Status.Phase == corev1.PodFailed || pod.Status.Phase == corev1.PodSucceeded {
return nil, fmt.Errorf("pod %s is in a terminal state: %s", podName, pod.Status.Phase)
}
return pod, nil
}
}
}
Expand Down

0 comments on commit cc25140

Please sign in to comment.