@@ -164,7 +164,7 @@ function waitForIngressPod() {
164
164
ns=$2
165
165
166
166
printInfo " Wait until ${type} ingress controller pod is running."
167
- ipod=$( ${kubernetesCli} -o name get po -n ${ns} )
167
+ ipod=$( ${kubernetesCli} -o name get po -n ${ns} | grep -v admission-patch )
168
168
if [[ " ${ipod} " != * $chart * ]]; then
169
169
printError " Couldn't find the pod associated with ${type} helm deployment. List helm deployment status on namespace [${ns} ]. "
170
170
helm list -n ${ns}
@@ -229,6 +229,26 @@ function createVoyager() {
229
229
exit 0;
230
230
fi
231
231
232
+ max=20
233
+ count=0
234
+ printInfo " Checking availability of voyager deployment [${chart} ]"
235
+ while test $count -lt $max ; do
236
+ status=$( ${kubernetesCli} get deployment --namespace ${ns} -l " app.kubernetes.io/name=voyager,app.kubernetes.io/instance=${chart} " --no-headers 2> /dev/null | awk ' {print $2}' || true)
237
+ if [ " ${status} " == " 1/1" ]; then
238
+ echo " "
239
+ printInfo " voyager deployment resource [${chart} ] is available now."
240
+ ${kubernetesCli} get deployment --namespace ${ns} -l " app.kubernetes.io/name=voyager,app.kubernetes.io/instance=${chart} "
241
+ break ;
242
+ fi
243
+ count=` expr $count + 1`
244
+ echo -n " ."
245
+ sleep 2
246
+ done
247
+ if test $count -eq $max ; then
248
+ printError " voyager deployment resource can not be created"
249
+ exit 1
250
+ fi
251
+
232
252
waitForIngressPod voyager ${ns}
233
253
234
254
max=20
@@ -293,20 +313,23 @@ function createTraefik() {
293
313
# Remove ingress related resources from default Namespace ( if any )
294
314
function purgeDefaultResources() {
295
315
printInfo " Remove ingress related resources from default Namespace (if any)"
296
- crole=$( ${kubernetesCli} get ClusterRole | grep ${chart} | awk ' {print $1}' )
297
- if [ " x${crole} " != " x" ]; then
298
- ${kubernetesCli} get ClusterRole | grep ${chart} | awk ' {print $1}' | xargs kubectl delete ClusterRole --ignore-not-found
299
- fi
316
+ croles=$( ${kubernetesCli} get ClusterRole | grep ${chart} | awk ' {print $1}' )
317
+ for crole in ${croles} ; do
318
+ printInfo " Deleting ClusterRole ${crole} from default Namespace"
319
+ ${kubernetesCli} delete ClusterRole ${crole}
320
+ done
300
321
301
- crb=$( ${kubernetesCli} get ClusterRoleBinding | grep ${chart} | awk ' {print $1}' )
302
- if [ x${crb} != " x" ]; then
303
- ${kubernetesCli} get ClusterRoleBinding | grep ${chart} | awk ' {print $1}' | xargs kubectl delete ClusterRoleBinding
304
- fi
322
+ crbs=$( ${kubernetesCli} get ClusterRoleBinding | grep ${chart} | awk ' {print $1}' )
323
+ for crb in ${crbs} ; do
324
+ printInfo " Deleting ClusterRoleBinding ${crb} from default Namespace"
325
+ ${kubernetesCli} delete ClusterRoleBinding ${crb}
326
+ done
305
327
306
- vwc=$( ${kubernetesCli} get ValidatingWebhookConfiguration | grep ${chart} | awk ' {print $1}' )
307
- if [ x${vwc} != " x" ]; then
308
- ${kubernetesCli} get ValidatingWebhookConfiguration | grep ${chart} | awk ' {print $1}' | xargs kubectl delete ValidatingWebhookConfiguration
309
- fi
328
+ vwcs=$( ${kubernetesCli} get ValidatingWebhookConfiguration | grep ${chart} | awk ' {print $1}' )
329
+ for vwc in ${vwcs} ; do
330
+ printInfo " Deleting ValidatingWebhookConfiguration ${vwc} from default Namespace"
331
+ ${kubernetesCli} delete ValidatingWebhookConfiguration ${vwc}
332
+ done
310
333
}
311
334
312
335
# Remove voyager related resources from default Namespace ( if any )
@@ -342,7 +365,7 @@ function purgeVoyagerResources() {
342
365
${kubernetesCli} delete ClusterRole/${chart} --ignore-not-found
343
366
${kubernetesCli} delete ClusterRoleBinding/${chart} --ignore-not-found
344
367
${kubernetesCli} delete ClusterRoleBinding/${chart} -apiserver-auth-delegator --ignore-not-found
345
- kubectl delete RoleBinding/${chart} -apiserver-extension-server-authentication-reader -n kube-system --ignore-not-found
368
+ ${kubernetesCli} delete RoleBinding/${chart} -apiserver-extension-server-authentication-reader -n kube-system --ignore-not-found
346
369
}
347
370
348
371
function deleteIngress() {
0 commit comments