Skip to content

Commit 81dbcd9

Browse files
author
Lily He
committed
update cleanup.sh
1 parent 742e38f commit 81dbcd9

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

kubernetes/internal/create-weblogic-domain.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,8 @@ function createDomain {
612612
#
613613
function setupVoyagerLoadBalancer {
614614
# only deploy Voyager Ingress Controller the first time
615-
local vcon=`kubectl get namespace voyager| grep voyager | wc | awk ' { print $1; } '`
616-
if [ "$vcon" == "0" ]; then
615+
local vpod=`kubectl get pod -n voyager | grep voyager | wc -l`
616+
if [ "$vpod" == "0" ]; then
617617
kubectl create namespace voyager
618618
curl -fsSL https://raw.githubusercontent.com/appscode/voyager/6.0.0/hack/deploy/voyager.sh \
619619
| bash -s -- --provider=baremetal --namespace=voyager

src/integration-tests/bash/cleanup.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Phase 1: Delete domain resources with label 'weblogic.domainUID'.
3131
#
3232
# Phase 2: Delete wls operator with lable 'weblogic.operatorName' and
33-
# voyager operator with lable 'app=voyager'.
33+
# delete voyager controller.
3434
#
3535
# Phase 3: Use a kubernetes job to delete the PV directories
3636
# on the kubernetes cluster.
@@ -105,22 +105,27 @@ function deleteResWithLabel {
105105
}
106106

107107
#
108-
# deleteOperators
108+
# deleteWLSOperators
109109
#
110-
function deleteOperators {
110+
function deleteWLSOperators {
111111
local tempfile="/tmp/$(basename $0).tmp.$$" # == /tmp/[script-file-name].tmp.[pid]
112112
# delete wls operator resources
113113
LABEL_SELECTOR="weblogic.operatorName"
114114
#getResWithLabel $tempfile
115115
deleteResWithLabel $tempfile
116+
}
116117

117-
# delete voyager operator resources
118-
LABEL_SELECTOR="app=voyager"
119-
#getResWithLabel $tempfile
120-
deleteResWithLabel $tempfile
118+
#
119+
# deleteVoyagerController
120+
#
121+
function deleteVoyagerController {
122+
curl -fsSL https://raw.githubusercontent.com/appscode/voyager/6.0.0/hack/deploy/voyager.sh \
123+
| bash -s -- --provider=baremetal --namespace=voyager --uninstall --purge
121124
}
122125

123126
echo @@ Starting cleanup.
127+
script="${BASH_SOURCE[0]}"
128+
scriptDir="$( cd "$(dirname "${script}")" > /dev/null 2>&1 ; pwd -P)"
124129

125130
echo "@@ RESULT_ROOT=$RESULT_ROOT TMP_DIR=$TMP_DIR RESULT_DIR=$RESULT_DIR PROJECT_ROOT=$PROJECT_ROOT"
126131

@@ -130,10 +135,13 @@ NAMESPACED_TYPES="pod,job,deploy,rs,service,pvc,ingress,cm,serviceaccount,role,r
130135
NOT_NAMESPACED_TYPES="pv,crd,clusterroles,clusterrolebindings"
131136

132137
# Delele domain resources.
133-
../../../kubernetes/delete-weblogic-domain-resources.sh -d all
138+
${scriptDir}/../../../kubernetes/delete-weblogic-domain-resources.sh -d all
139+
140+
# Delete wls operator
141+
deleteWLSOperators
134142

135-
# Delete wls operator and voyager operator
136-
deleteOperators
143+
# Delete voyager controller
144+
deleteVoyagerController
137145

138146
# Delete pv directories using a job (/scratch maps to PV_ROOT on the k8s cluster machines).
139147

@@ -166,3 +174,4 @@ fi
166174

167175
echo @@ Exiting with status $SUCCESS
168176
exit $SUCCESS
177+

0 commit comments

Comments
 (0)