File tree 2 files changed +27
-4
lines changed
kubernetes/samples/scripts
create-weblogic-domain/domain-home-on-pv
2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # Copyright (c) 2018, 2021 , Oracle and/or its affiliates.
2
+ # Copyright (c) 2018, 2022 , Oracle and/or its affiliates.
3
3
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4
4
5
5
#
@@ -926,3 +926,26 @@ function checkService(){
926
926
done
927
927
echo " Service [$svc ] found"
928
928
}
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
+ }
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # Copyright (c) 2018, 2021 , Oracle and/or its affiliates.
2
+ # Copyright (c) 2018, 2022 , Oracle and/or its affiliates.
3
3
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4
4
#
5
5
# Description
@@ -212,9 +212,9 @@ function createDomainHome {
212
212
# domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.
213
213
214
214
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} " )
216
216
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}
218
218
# echo "Fetching results"
219
219
sleep 30
220
220
max=30
You can’t perform that action at this time.
0 commit comments