@@ -64,7 +64,6 @@ function getVoyagerOfDomain {
64
64
local ns=` kubectl get ingress.voyager.appscode.com --all-namespaces | grep $domainName | awk ' { print $1 }' `
65
65
if [ -n " $ns " ]; then
66
66
echo $voyagerIngressName $domainName -voyager -n $ns >> $2
67
- echo service $domainName -voyager-stats -n $ns >> $2
68
67
fi
69
68
}
70
69
@@ -116,8 +115,12 @@ function getDomainResources {
116
115
LABEL_SELECTOR=" weblogic.domainUID in ($1 )"
117
116
fi
118
117
119
- # first, let's get all namespaced types with -l $LABEL_SELECTOR
118
+ # clean the output file
119
+ if [ -e $2 ]; then
120
+ rm $2
121
+ fi
120
122
123
+ # first, let's get all namespaced types with -l $LABEL_SELECTOR
121
124
NAMESPACED_TYPES=" pod,job,deploy,rs,service,pvc,ingress,cm,serviceaccount,role,rolebinding,secret"
122
125
123
126
# if domain crd exists, look for domains too:
@@ -129,7 +132,7 @@ function getDomainResources {
129
132
kubectl get $NAMESPACED_TYPES \
130
133
-l " $LABEL_SELECTOR " \
131
134
-o=jsonpath=' {range .items[*]}{.kind}{" "}{.metadata.name}{" -n "}{.metadata.namespace}{"\n"}{end}' \
132
- --all-namespaces=true > $2
135
+ --all-namespaces=true >> $2
133
136
134
137
# now, get all non-namespaced types with -l $LABEL_SELECTOR
135
138
@@ -240,9 +243,9 @@ function deleteDomains {
240
243
# for each namespace with leftover resources, try delete them
241
244
cat $tempfile | awk ' { print $4 }' | grep -v " ^$" | sort -u | while read line; do
242
245
if [ " $test_mode " = " true" ]; then
243
- echo kubectl -n $line delete $NAMESPACED_TYPES -l " $LABEL_SELECTOR "
246
+ echo kubectl -n $line delete $NAMESPACED_TYPES ,ingress.voyager.appscode.com -l " $LABEL_SELECTOR "
244
247
else
245
- kubectl -n $line delete $NAMESPACED_TYPES -l " $LABEL_SELECTOR "
248
+ kubectl -n $line delete $NAMESPACED_TYPES ,ingress.voyager.appscode.com -l " $LABEL_SELECTOR "
246
249
fi
247
250
done
248
251
0 commit comments