diff options
author | Sylvain Desbureaux <sylvain.desbureaux@orange.com> | 2020-10-21 11:30:08 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-10-21 11:30:08 +0000 |
commit | 3ed223d7f77b43033fa97d584246db4a386d6b0c (patch) | |
tree | 2d4bcab02b9e734e3028ecf1d0ee6a8357d61375 | |
parent | de60649a59fe924175a25e05eb8ca31efe63daeb (diff) | |
parent | dd364d3f93be7f436c3ae3d62dafb930b9a491fe (diff) |
Merge "[HELM] Update helm deploy plugin"
-rwxr-xr-x | kubernetes/helm/plugins/deploy/deploy.sh | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh index bb98a3b95e..40338b9485 100755 --- a/kubernetes/helm/plugins/deploy/deploy.sh +++ b/kubernetes/helm/plugins/deploy/deploy.sh @@ -98,7 +98,12 @@ deploy() { FLAGS=${@:3} CHART_REPO="$(cut -d'/' -f1 <<<"$CHART_URL")" CHART_NAME="$(cut -d'/' -f2 <<<"$CHART_URL")" - CACHE_DIR=~/.helm/plugins/deploy/cache + if [[ $HELM_VER == "v3."* ]]; then + CACHE_DIR=~/.local/share/helm/plugins/deploy/cache + else + CACHE_DIR=~/.helm/plugins/deploy/cache + fi + echo "Use cache dir: $CACHE_DIR" CHART_DIR=$CACHE_DIR/$CHART_NAME CACHE_SUBCHART_DIR=$CHART_DIR-subcharts LOG_DIR=$CHART_DIR/logs @@ -114,7 +119,7 @@ deploy() { if [[ $FLAGS = *"--delay"* ]]; then FLAGS="$(echo $FLAGS| sed -n 's/--delay//p')" DELAY="true" - fi + fi # determine if set-last-applied flag is enabled SET_LAST_APPLIED="false" if [[ $FLAGS = *"--set-last-applied"* ]]; then @@ -246,12 +251,16 @@ deploy() { if [[ $DELAY == "true" ]]; then echo sleep 3m sleep 3m - fi + fi else array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}")) n=${#array[*]} for (( i = n-1; i >= 0; i-- )); do - helm del "${array[i]}" --purge + if [[ $HELM_VER == "v3."* ]]; then + helm del "${array[i]}" + else + helm del "${array[i]}" --purge + fi done fi done @@ -259,6 +268,8 @@ deploy() { # report on success/failures of installs/upgrades helm ls | grep FAILED | grep $RELEASE } +HELM_VER=$(helm version --template "{{.Version}}") +echo $HELM_VER case "${1:-"help"}" in "help") |