aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2022-01-03 08:08:32 +0000
committerGerrit Code Review <gerrit@onap.org>2022-01-03 08:08:32 +0000
commit22d003720035687e4db6acf248d20fa4e2c2975a (patch)
tree2185df67536356b4013ae4660874c10a0088b67a /kubernetes
parent16337dc397afe0668e609d7edbcc5dc74d79b849 (diff)
parenta64592e908c0d302cef785e8c048e60e57b2d568 (diff)
Merge "[COMMON] Fix more array bashisms"
Diffstat (limited to 'kubernetes')
-rwxr-xr-xkubernetes/helm/plugins/undeploy/undeploy.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/kubernetes/helm/plugins/undeploy/undeploy.sh b/kubernetes/helm/plugins/undeploy/undeploy.sh
index a3b0e3c623..dca4499aa1 100755
--- a/kubernetes/helm/plugins/undeploy/undeploy.sh
+++ b/kubernetes/helm/plugins/undeploy/undeploy.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
usage() {
cat << EOF
@@ -21,11 +21,14 @@ undeploy() {
RELEASE=$1
FLAGS=$2
- array=($(helm ls -q --all | grep $RELEASE))
- n=${#array[*]}
- for i in $(seq $(($n-1)) -1 0)
+ reverse_list=
+ for item in $(helm ls -q --all | grep $RELEASE)
do
- helm del "${array[i]}" $FLAGS
+ reverse_list="$item $reverse_list"
+ done
+ for item in $reverse_list
+ do
+ helm del $item $FLAGS
done
}