Skip to content

Commit a649328

Browse files
author
Lily He
committed
update delete-weblogic-domain-resources.sh to delete voyager res
1 parent 12a6941 commit a649328

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

kubernetes/create-weblogic-domain-inputs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ exposeAdminNodePort: false
8585
# Name of the domain namespace
8686
namespace: default
8787

88-
# Load balancer to deploy. Supported values are:TRAEFIK, NONE
88+
# Load balancer to deploy. Supported values are:TRAEFIK, VOYAGER, NONE
8989
loadBalancer: TRAEFIK
9090

9191
# Load balancer web port

kubernetes/delete-weblogic-domain-resources.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,47 @@ cat << EOF
5353
EOF
5454
}
5555

56+
#
57+
# get voyager related resources of one domain
58+
#
59+
# Usage:
60+
# getVoyagerOfDomain domainName outfilename
61+
function getVoyagerOfDomain {
62+
local voyagerIngressName="ingress.voyager.appscode.com"
63+
local domainName=$1
64+
local ns=`kubectl get ingress.voyager.appscode.com --all-namespaces | grep $domainName | awk '{ print $1 }'`
65+
if [ -n "$ns" ]; then
66+
echo $voyagerIngressName $domainName-voyager -n $ns >> $2
67+
echo service $domainName-voyager-stats -n $ns >> $2
68+
fi
69+
}
70+
71+
#
72+
# get voyager related resources
73+
#
74+
# Usage:
75+
# getVoyagerRes domainA,domainB,... outfilename
76+
# getVoyagerRes all outfilename
77+
function getVoyagerRes {
78+
if [ "$1" = "all" ]; then
79+
resList=`kubectl get ingress.voyager.appscode.com --all-namespaces | awk '{print $2}'`
80+
for resName in $resList
81+
do
82+
if [ $resName != 'NAME' ]; then
83+
tail="-voyager"
84+
len=${#resName}-${#tail}
85+
domainName=${resName:0:len}
86+
getVoyagerOfDomain $domainName $2
87+
fi
88+
done
89+
else
90+
IFS=',' read -r -a array <<< "$1"
91+
for domainName in "${array[@]}"
92+
do
93+
getVoyagerOfDomain $domainName $2
94+
done
95+
fi
96+
}
5697

5798
#
5899
# getDomainResources domain(s) outfilename
@@ -98,6 +139,9 @@ function getDomainResources {
98139
-l "$LABEL_SELECTOR" \
99140
-o=jsonpath='{range .items[*]}{.kind}{" "}{.metadata.name}{"\n"}{end}' \
100141
--all-namespaces=true >> $2
142+
143+
# get all voyager-related resources
144+
getVoyagerRes $1 $2
101145
}
102146

103147
#

0 commit comments

Comments
 (0)