aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-06-15 21:57:16 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-15 21:57:16 +0000
commitbb3f4c1abf14069c47f99edbb4f1d4859e70abde (patch)
treea1cbbf4407a62e5fd76d2126be64edb31c0cafab
parent89ec09e573325c9462815a806e2f45a1e4716dff (diff)
parent10341749c8db075fbd0d6b9684a1b7bf7aab6b33 (diff)
Merge "Increase helm deploy perf by reducing helm ls"
-rwxr-xr-xkubernetes/helm/plugins/deploy/deploy.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh
index 2bbae80a3e..3416a02596 100755
--- a/kubernetes/helm/plugins/deploy/deploy.sh
+++ b/kubernetes/helm/plugins/deploy/deploy.sh
@@ -206,6 +206,9 @@ deploy() {
# upgrade/install each "enabled" subchart
cd $CACHE_SUBCHART_DIR/
+ #“helm ls” is an expensive command in that it can take a long time to execute.
+ #So cache the results to prevent repeated execution.
+ ALL_HELM_RELEASES=$(helm ls -q)
for subchart in * ; do
SUBCHART_OVERRIDES=$CACHE_SUBCHART_DIR/$subchart/subchart-overrides.yaml
@@ -236,7 +239,7 @@ deploy() {
fi
fi
else
- array=($(helm ls -q | grep "${RELEASE}-${subchart}"))
+ array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}"))
n=${#array[*]}
for (( i = n-1; i >= 0; i-- )); do
helm del "${array[i]}" --purge