File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ function updateDomainHome {
200200 # There is no way to re-run a kubernetes job, so first delete any prior job
201201 CONTAINER_NAME=" update-weblogic-sample-domain-job"
202202 JOB_NAME=" ${domainUID} -${CONTAINER_NAME} "
203+ OLD_POD_NAME=` kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
203204 deleteK8sObj job $JOB_NAME ${createJobOutput}
204205
205206 echo update the domain by creating the job ${createJobOutput}
@@ -209,7 +210,16 @@ function updateDomainHome {
209210 # a pod which will run a script that creates a domain. The script then will extract the domain
210211 # resource using WDT's extractDomainResource tool. So, the following code loops until the
211212 # domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.
213+ local end_secs=$(( SECONDS + 30 ))
212214 POD_NAME=` kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
215+ while [ -z " ${POD_NAME} " ] || [ " $POD_NAME " = " $OLD_POD_NAME " ]; do
216+ if [ $SECONDS -gt $end_secs ]; then
217+ fail " Job pod was not find in 30 seconds"
218+ fi
219+ sleep 1
220+ POD_NAME=` kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } ' `
221+ echo " Pod name is $POD_NAME "
222+ done
213223 echo " Waiting for results to be available from $POD_NAME "
214224 kubectl wait --timeout=600s --for=condition=ContainersReady pod $POD_NAME
215225 sleep 30
You can’t perform that action at this time.
0 commit comments