diff options
author | Guillaume Lambert <guillaume.lambert@orange.com> | 2021-03-11 15:53:15 +0100 |
---|---|---|
committer | Krzysztof Opasiak <k.opasiak@samsung.com> | 2021-05-11 17:50:14 +0000 |
commit | 3ec69ace22277da78ba3de681078478e7f036bd0 (patch) | |
tree | 9807e827eb92aa9d0830293dd5b324acbf8960d7 /kubernetes/helm/plugins/deploy/deploy.sh | |
parent | fd9c202816c479e98edde2f3f92625825141013e (diff) |
[COMMON] Fix arithmetic loop bashisms
pointed out by checkbashisms.
Issue-ID: OOM-2643
Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Change-Id: I85fd7d9beca75dc729de247fa67a20b801748c19
Diffstat (limited to 'kubernetes/helm/plugins/deploy/deploy.sh')
-rwxr-xr-x | kubernetes/helm/plugins/deploy/deploy.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh index 44e8e56aa5..0d434ad877 100755 --- a/kubernetes/helm/plugins/deploy/deploy.sh +++ b/kubernetes/helm/plugins/deploy/deploy.sh @@ -70,7 +70,7 @@ generate_overrides() { resolve_deploy_flags() { flags=($1) n=${#flags[*]} - for (( i = 0; i < n; i++ )); do + i=0 ; while [ "$i" -lt "$n" ]; do PARAM=${flags[i]} if [[ $PARAM = "-f" || \ $PARAM = "--values" || \ @@ -82,6 +82,7 @@ resolve_deploy_flags() { else DEPLOY_FLAGS="$DEPLOY_FLAGS $PARAM" fi + i=$((i+1)) done echo "$DEPLOY_FLAGS" } @@ -255,7 +256,7 @@ deploy() { else array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}")) n=${#array[*]} - for (( i = n-1; i >= 0; i-- )); do + for i in $(seq $(($n-1)) -1 0); do if [[ $HELM_VER = "v3."* ]]; then helm del "${array[i]}" else |