From 6b5b925624e67984ac7830458c6abe06cd12fd2f Mon Sep 17 00:00:00 2001 From: Steven Wade Date: Fri, 12 Jun 2020 11:52:19 +0100 Subject: [PATCH] Setting repo name to be the md5sum of the registry This has increased our build time and also hrval consistency. --- src/hrval.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hrval.sh b/src/hrval.sh index 1472095..8242622 100755 --- a/src/hrval.sh +++ b/src/hrval.sh @@ -28,13 +28,17 @@ function download { CHART_NAME=$(yq r ${1} spec.chart.name) CHART_VERSION=$(yq r ${1} spec.chart.version) CHART_DIR=${2}/${CHART_NAME} + + CHART_REPO_MD5=`/bin/echo $CHART_REPO | /usr/bin/md5sum | cut -f1 -d" "` if [[ ${HELM_VER} == "v3" ]]; then - helmv3 repo add ${CHART_NAME} ${CHART_REPO} - helmv3 fetch --version ${CHART_VERSION} --untar ${CHART_NAME}/${CHART_NAME} --untardir ${2} + helmv3 repo add ${CHART_REPO_MD5} ${CHART_REPO} + helm3 repo update + helmv3 fetch --version ${CHART_VERSION} --untar ${CHART_REPO_MD5}/${CHART_NAME} --untardir ${2} else - helm repo add ${CHART_NAME} ${CHART_REPO} - helm fetch --version ${CHART_VERSION} --untar ${CHART_NAME}/${CHART_NAME} --untardir ${2} + helm repo add ${CHART_REPO_MD5} ${CHART_REPO} + helm repo update + helm fetch --version ${CHART_VERSION} --untar ${CHART_REPO_MD5}/${CHART_NAME} --untardir ${2} fi echo ${CHART_DIR}