Skip to content

Commit 07cc511

Browse files
Merge pull request #2696 from oracle/OWLS-94849-backport
backport of OWLS-94849 to 3.3 release branch
2 parents 42830fc + f5279e4 commit 07cc511

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

kubernetes/samples/scripts/common/utility.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2+
# Copyright (c) 2018, 2022, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44

55
#
@@ -926,3 +926,26 @@ function checkService(){
926926
done
927927
echo "Service [$svc] found"
928928
}
929+
930+
# Get pod name when pod available in a given namespace
931+
function getPodName(){
932+
933+
local max=$((SECONDS + 120))
934+
935+
local pod=$1
936+
local ns=$2
937+
938+
local pname=""
939+
while [ $SECONDS -le $max ] ; do
940+
pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
941+
[ -z "${pname}" ] || break
942+
sleep 1
943+
done
944+
945+
if [ -z "${pname}" ] ; then
946+
echo "[ERROR] Could not find Pod [$pod] after $max seconds";
947+
exit 1
948+
fi
949+
950+
echo "${pname}"
951+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
2+
# Copyright (c) 2018, 2022, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
# Description
@@ -212,9 +212,9 @@ function createDomainHome {
212212
# domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.
213213

214214
if [ "$useWdt" = true ]; then
215-
POD_NAME=`kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } '`
215+
POD_NAME=$(getPodName "${JOB_NAME}" "${namespace}")
216216
echo "Waiting for results to be available from $POD_NAME"
217-
kubectl wait --timeout=600s --for=condition=ContainersReady pod $POD_NAME
217+
kubectl wait --timeout=600s --for=condition=ContainersReady pod $POD_NAME -n ${namespace}
218218
#echo "Fetching results"
219219
sleep 30
220220
max=30

0 commit comments

Comments
 (0)