summaryrefslogtreecommitdiffstats
path: root/kubernetes/helm/plugins/deploy
diff options
context:
space:
mode:
authorJoey Sullivan <joey.sullivan@amdocs.com>2019-06-11 10:38:51 -0400
committerJoey Sullivan <joey.sullivan@amdocs.com>2019-06-11 11:23:49 -0400
commit10341749c8db075fbd0d6b9684a1b7bf7aab6b33 (patch)
tree68b8c8ac43df99f6624cc74ca8b06be6eaed6947 /kubernetes/helm/plugins/deploy
parentd55a1b07f956c98a48e336baf634ef61db9e7a71 (diff)
Increase helm deploy perf by reducing helm ls
Helm ls takes a lot of time to execute. This code change makes sure it only executes once per helm deploy instead of once per helm release. Issue-ID: OOM-1923 Signed-off-by: Joey Sullivan <joey.sullivan@amdocs.com> Change-Id: I6337c97380d9f583b33f55a2be1d41ac7ce350c8
Diffstat (limited to 'kubernetes/helm/plugins/deploy')
-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