Skip to content

backport of OWLS-94849 to 3.3 release branch #2696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion kubernetes/samples/scripts/common/utility.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
# Copyright (c) 2018, 2022, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

#
Expand Down Expand Up @@ -926,3 +926,26 @@ function checkService(){
done
echo "Service [$svc] found"
}

# Get pod name when pod available in a given namespace
function getPodName(){

local max=$((SECONDS + 120))

local pod=$1
local ns=$2

local pname=""
while [ $SECONDS -le $max ] ; do
pname=`kubectl get po -n ${ns} | grep -w ${pod} | awk '{print $1}'`
[ -z "${pname}" ] || break
sleep 1
done

if [ -z "${pname}" ] ; then
echo "[ERROR] Could not find Pod [$pod] after $max seconds";
exit 1
fi

echo "${pname}"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2018, 2021, Oracle and/or its affiliates.
# Copyright (c) 2018, 2022, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
# Description
Expand Down Expand Up @@ -212,9 +212,9 @@ function createDomainHome {
# domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.

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