@@ -295,6 +295,10 @@ function createYamlFiles {
295
295
domainPVMountPath=" /shared"
296
296
fi
297
297
298
+ if [ -z " ${logHome} " ]; then
299
+ logHome=" /shared/logs/${domainUID} "
300
+ fi
301
+
298
302
# Use the default value if not defined.
299
303
if [ -z " ${createDomainScriptsMountPath} " ]; then
300
304
createDomainScriptsMountPath=" /u01/weblogic"
@@ -377,6 +381,7 @@ function createYamlFiles {
377
381
cp ${dcrInput} ${dcrOutput}
378
382
sed -i -e " s:%NAMESPACE%:$namespace :g" ${dcrOutput}
379
383
sed -i -e " s:%WEBLOGIC_CREDENTIALS_SECRET_NAME%:${weblogicCredentialsSecretName} :g" ${dcrOutput}
384
+ sed -i -e " s:%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%:${imagePullSecretPrefix} :g" ${dcrOutput}
380
385
sed -i -e " s:%DOMAIN_UID%:${domainUID} :g" ${dcrOutput}
381
386
sed -i -e " s:%DOMAIN_NAME%:${domainName} :g" ${dcrOutput}
382
387
sed -i -e " s:%DOMAIN_HOME%:${domainHome} :g" ${dcrOutput}
@@ -464,34 +469,35 @@ function createDomainHome {
464
469
while [ " $JOB_STATUS " != " Completed" -a $count -lt $max ] ; do
465
470
sleep 30
466
471
count=` expr $count + 1`
467
- JOB_STATUS=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $3; } ' `
468
- 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; } ' `
469
476
echo " status on iteration $count of $max "
470
477
echo " $JOB_INFO "
471
478
472
479
# Terminate the retry loop when a fatal error has already occurred. Search for "ERROR:" in the job log file
473
480
if [ " $JOB_STATUS " != " Completed" ]; then
474
- JOB_ERRORS=` kubectl logs jobs/$JOB_NAME -n ${namespace} | grep " ERROR:" `
475
481
ERR_COUNT=` echo $JOB_ERRORS | grep " ERROR:" | wc | awk ' {print $1; }' `
476
482
if [ " $ERR_COUNT " != " 0" ]; then
477
- echo A failure was detected in the log file for job $JOB_NAME
478
- echo $JOB_ERRORS
479
- echo Check the log output for additional information
480
- 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! "
481
487
fi
482
488
fi
483
489
done
484
490
485
491
# Confirm the job pod is status completed
486
- JOB_POD=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
487
492
if [ " $JOB_STATUS " != " Completed" ]; then
488
- echo The create domain job is not showing status completed after waiting 300 seconds
489
- 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. "
490
495
kubectl logs jobs/$JOB_NAME -n ${namespace}
491
496
fail " Exiting due to failure - the job status is not Completed!"
492
497
fi
493
498
494
499
# Check for successful completion in log file
500
+ JOB_POD=` kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
495
501
JOB_STS=` kubectl logs $JOB_POD -n ${namespace} | grep " Successfully Completed" | awk ' { print $1; } ' `
496
502
if [ " ${JOB_STS} " != " Successfully" ]; then
497
503
echo The log file for the create domain job does not contain a successful completion status
0 commit comments