Skip to content

Commit b76e790

Browse files
authored
Merge pull request #901 from oracle/owls-72018
Changes to domain-home-on-pv scripts for istio environment
2 parents 07aeb46 + 334121a commit b76e790

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain-job-template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ spec:
1313
weblogic.domainUID: %DOMAIN_UID%
1414
weblogic.domainName: %DOMAIN_NAME%
1515
app: %DOMAIN_UID%-create-weblogic-sample-domain-job
16+
annotations:
17+
sidecar.istio.io/inject: "false"
1618
spec:
1719
restartPolicy: Never
1820
containers:

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ function createDomainHome {
180180
createDomainConfigmap
181181

182182
# There is no way to re-run a kubernetes job, so first delete any prior job
183-
JOB_NAME="${domainUID}-create-weblogic-sample-domain-job"
183+
CONTAINER_NAME="create-weblogic-sample-domain-job"
184+
JOB_NAME="${domainUID}-${CONTAINER_NAME}"
184185
deleteK8sObj job $JOB_NAME ${createJobOutput}
185186

186187
echo Creating the domain by creating the job ${createJobOutput}
@@ -193,8 +194,8 @@ function createDomainHome {
193194
while [ "$JOB_STATUS" != "Completed" -a $count -lt $max ] ; do
194195
sleep 30
195196
count=`expr $count + 1`
196-
JOBS=`kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME}`
197-
JOB_ERRORS=`kubectl logs jobs/$JOB_NAME -n ${namespace} | grep "ERROR:" `
197+
JOBS=`kubectl get pods -n ${namespace} | grep ${JOB_NAME}`
198+
JOB_ERRORS=`kubectl logs jobs/$JOB_NAME $CONTAINER_NAME -n ${namespace} | grep "ERROR:" `
198199
JOB_STATUS=`echo $JOBS | awk ' { print $3; } '`
199200
JOB_INFO=`echo $JOBS | awk ' { print "pod", $1, "status is", $3; } '`
200201
echo "status on iteration $count of $max"
@@ -216,17 +217,17 @@ function createDomainHome {
216217
if [ "$JOB_STATUS" != "Completed" ]; then
217218
echo "The create domain job is not showing status completed after waiting 300 seconds."
218219
echo "Check the log output for errors."
219-
kubectl logs jobs/$JOB_NAME -n ${namespace}
220+
kubectl logs jobs/$JOB_NAME $CONTAINER_NAME -n ${namespace}
220221
fail "Exiting due to failure - the job status is not Completed!"
221222
fi
222223

223224
# Check for successful completion in log file
224-
JOB_POD=`kubectl get pods --show-all -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } '`
225-
JOB_STS=`kubectl logs $JOB_POD -n ${namespace} | grep "Successfully Completed" | awk ' { print $1; } '`
225+
JOB_POD=`kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } '`
226+
JOB_STS=`kubectl logs $JOB_POD $CONTAINER_NAME -n ${namespace} | grep "Successfully Completed" | awk ' { print $1; } '`
226227
if [ "${JOB_STS}" != "Successfully" ]; then
227228
echo The log file for the create domain job does not contain a successful completion status
228229
echo Check the log output for errors
229-
kubectl logs $JOB_POD -n ${namespace}
230+
kubectl logs $JOB_POD $CONTAINER_NAME -n ${namespace}
230231
fail "Exiting due to failure - the job log file does not contain a successful completion status!"
231232
fi
232233
}

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/delete-domain-job-template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ spec:
3131
weblogic.domainUID: %DOMAIN_UID%
3232
weblogic.domainName: %DOMAIN_NAME%
3333
app: %DOMAIN_UID%-delete-weblogic-sample-domain-job
34+
annotations:
35+
sidecar.istio.io/inject: "false"
3436
spec:
3537
restartPolicy: Never
3638
containers:

0 commit comments

Comments
 (0)