@@ -469,34 +469,35 @@ function createDomainHome {
469
469
while [ " $JOB_STATUS " != " Completed" -a $count -lt $max ] ; do
470
470
sleep 30
471
471
count=` expr $count + 1`
472
- JOB_STATUS=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $3; } ' `
473
- JOB_INFO=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print "pod", $1, "status is", $3; } ' `
472
+ JOBS=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} `
473
+ JOB_ERRORS=` kubectl logs jobs/$JOB_NAME -n ${namespace} | grep " ERROR:" `
474
+ JOB_STATUS=` echo $JOBS | awk ' { print $3; } ' `
475
+ JOB_INFO=` echo $JOBS | awk ' { print "pod", $1, "status is", $3; } ' `
474
476
echo " status on iteration $count of $max "
475
477
echo " $JOB_INFO "
476
478
477
479
# Terminate the retry loop when a fatal error has already occurred. Search for "ERROR:" in the job log file
478
480
if [ " $JOB_STATUS " != " Completed" ]; then
479
- JOB_ERRORS=` kubectl logs jobs/$JOB_NAME -n ${namespace} | grep " ERROR:" `
480
481
ERR_COUNT=` echo $JOB_ERRORS | grep " ERROR:" | wc | awk ' {print $1; }' `
481
482
if [ " $ERR_COUNT " != " 0" ]; then
482
- echo A failure was detected in the log file for job $JOB_NAME
483
- echo $JOB_ERRORS
484
- echo Check the log output for additional information
485
- fail " Exiting due to failure - the job has failed"
483
+ echo " A failure was detected in the log file for job $JOB_NAME . "
484
+ echo " $JOB_ERRORS "
485
+ echo " Check the log output for additional information. "
486
+ fail " Exiting due to failure - the job has failed! "
486
487
fi
487
488
fi
488
489
done
489
490
490
491
# Confirm the job pod is status completed
491
- JOB_POD=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
492
492
if [ " $JOB_STATUS " != " Completed" ]; then
493
- echo The create domain job is not showing status completed after waiting 300 seconds
494
- echo Check the log output for errors
493
+ echo " The create domain job is not showing status completed after waiting 300 seconds. "
494
+ echo " Check the log output for errors. "
495
495
kubectl logs jobs/$JOB_NAME -n ${namespace}
496
496
fail " Exiting due to failure - the job status is not Completed!"
497
497
fi
498
498
499
499
# Check for successful completion in log file
500
+ JOB_POD=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
500
501
JOB_STS=` kubectl logs $JOB_POD -n ${namespace} | grep " Successfully Completed" | awk ' { print $1; } ' `
501
502
if [ " ${JOB_STS} " != " Successfully" ]; then
502
503
echo The log file for the create domain job does not contain a successful completion status
0 commit comments