File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
kubernetes/samples/scripts
create-weblogic-domain/domain-home-on-pv Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments