Skip to content

Commit 59c01b7

Browse files
authored
feat(verify.go): Add pod fail reason and message to output (#9589)
* feat(verify.go): Add pod fail reason and message to output Signed-off-by: Suleiman Dibirov <[email protected]> * fix verify.go Signed-off-by: Suleiman Dibirov <[email protected]> --------- Signed-off-by: Suleiman Dibirov <[email protected]>
1 parent b8dd23a commit 59c01b7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pkg/skaffold/verify/k8sjob/verify.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,20 @@ func (v *Verifier) watchJob(ctx context.Context, clientset k8sclient.Interface,
279279
break
280280
}
281281
if pod.Status.Phase == corev1.PodFailed {
282-
podErr = errors.New(fmt.Sprintf("%q running job %q errored during run", tc.Name, job.Name))
282+
failReason := pod.Status.Reason
283+
if failReason == "" {
284+
failReason = "<empty>"
285+
}
286+
287+
failMessage := pod.Status.Message
288+
if failMessage == "" {
289+
failMessage = "<empty>"
290+
}
291+
292+
podErr = fmt.Errorf(
293+
"%q running job %q errored during run: reason=%q, message=%q",
294+
tc.Name, job.Name, failReason, failMessage,
295+
)
283296
break
284297
}
285298

0 commit comments

Comments
 (0)