Skip to content

Commit 85a2412

Browse files
committed
Actually fail on dataproc errors
1 parent f3acb8e commit 85a2412

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/distribution/run_gcp_quickstart.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ function check_dataproc_job_state() {
5555
exit 1
5656
fi
5757
echo -e "${GREEN} <<<<<<<<<<<<<<<<-----------------JOB STATUS----------------->>>>>>>>>>>>>>>>>\033[0m"
58-
JOB_STATE=$(gcloud dataproc jobs describe $JOB_ID --region=us-central1 --format=flattened | grep "status.state:")
58+
JOB_STATE=$(gcloud dataproc jobs describe $JOB_ID --region=us-central1 --format=flattened | grep "status.state:" | awk '{print $NF}')
5959
echo $JOB_STATE
6060
# TODO: this doesn't actually fail. need to fix.
61-
if [ -z "$JOB_STATE" ]; then
61+
if [ -z "$JOB_STATE" ] || [ "$JOB_STATE" == "ERROR" ]; then
6262
echo -e "${RED} <<<<<<<<<<<<<<<<-----------------JOB FAILED!----------------->>>>>>>>>>>>>>>>>\033[0m"
6363
exit 1
6464
fi

0 commit comments

Comments
 (0)