From bc0114c70841e2a05c95e53e20358fb761dbfb2e Mon Sep 17 00:00:00 2001 From: Solomon Wakhungu <65043605+1solomonwakhungu@users.noreply.github.com> Date: Mon, 27 Jul 2026 13:55:05 -0500 Subject: [PATCH] fix(scripts): clarify cache-busting behavior Signed-off-by: Solomon Wakhungu <65043605+1solomonwakhungu@users.noreply.github.com> --- scripts/get-helm-3 | 3 ++- scripts/get-helm-4 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/get-helm-3 b/scripts/get-helm-3 index 117ae3e03..a73b3da2a 100755 --- a/scripts/get-helm-3 +++ b/scripts/get-helm-3 @@ -114,12 +114,13 @@ verifySupported() { checkDesiredVersion() { if [ "x$DESIRED_VERSION" == "x" ]; then # Get tag from release URL + # Cache behavior is provider-specific, so this mitigation is best effort. # The current CDN does not revalidate on the request no-cache directive, # so use a unique query while retaining no-cache for compliant intermediaries. local latest_release_url="https://get.helm.sh/helm3-latest-version?ts=$(date +%s)" local latest_release_response="" if [ "${HAS_CURL}" == "true" ]; then - latest_release_response=$( curl -L --silent --show-error --fail -H "Cache-Control: no-cache" "$latest_release_url" 2>&1 || true ) + latest_release_response=$( curl -L --silent --show-error --fail --header "Cache-Control: no-cache" "$latest_release_url" 2>&1 || true ) elif [ "${HAS_WGET}" == "true" ]; then latest_release_response=$( wget "$latest_release_url" --header="Cache-Control: no-cache" -q -O - 2>&1 || true ) fi diff --git a/scripts/get-helm-4 b/scripts/get-helm-4 index 0ff312a7f..3d232cca9 100644 --- a/scripts/get-helm-4 +++ b/scripts/get-helm-4 @@ -114,12 +114,13 @@ verifySupported() { checkDesiredVersion() { if [ "x$DESIRED_VERSION" == "x" ]; then # Get tag from release URL + # Cache behavior is provider-specific, so this mitigation is best effort. # The current CDN does not revalidate on the request no-cache directive, # so use a unique query while retaining no-cache for compliant intermediaries. local latest_release_url="https://get.helm.sh/helm4-latest-version?ts=$(date +%s)" local latest_release_response="" if [ "${HAS_CURL}" == "true" ]; then - latest_release_response=$( curl -L --silent --show-error --fail -H "Cache-Control: no-cache" "$latest_release_url" 2>&1 || true ) + latest_release_response=$( curl -L --silent --show-error --fail --header "Cache-Control: no-cache" "$latest_release_url" 2>&1 || true ) elif [ "${HAS_WGET}" == "true" ]; then latest_release_response=$( wget "$latest_release_url" --header="Cache-Control: no-cache" -q -O - 2>&1 || true ) fi