From: guillaume.lambert Date: Wed, 8 Dec 2021 10:35:45 +0000 (+0100) Subject: [COMMON] Fix more array bashisms X-Git-Tag: 10.0.0~158^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=a64592e908c0d302cef785e8c048e60e57b2d568;p=oom.git [COMMON] Fix more array bashisms pointed out by checkbashisms. Issue-ID: OOM-2643 Signed-off-by: guillaume.lambert Change-Id: Ia22b064a6bda5f7e2cb50247bc3c47a8b162466c --- 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 }