Skip to content

Commit d84415e

Browse files
authored
Owls100056 backport PR#3210 to release/3.4 (#3221)
* Backport PR#3210
1 parent 961f377 commit d84415e

File tree

1 file changed

+10
-0
lines changed
  • kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv

1 file changed

+10
-0
lines changed

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)