diff --git a/.github/scripts/fetch_helm_deps.sh b/.github/scripts/fetch_helm_deps.sh index eefb82b6e3a..20d065838e1 100755 --- a/.github/scripts/fetch_helm_deps.sh +++ b/.github/scripts/fetch_helm_deps.sh @@ -94,13 +94,22 @@ for idx in $(eval echo "{0..$length}"); do # Extract url from repo_url. It's under .entries.DEP_NAME.urls. We filter the specific version first (.version) dep_url=$(v="$version" n="$name" go-yq '.entries.[env(n)].[] | select (.version == env(v)) | .urls.[0]' "$index_cache/$repo_dir/index.yaml") - # tmp hotpatch for cert-manager - if [[ ! "$dep_url" == "https"* ]]; then - if [[ "$name" =~ "cert-manager" ]]; then - dep_url="https://charts.jetstack.io/${dep_url}" - fi + if [[ ! "$dep_url" == "https"* ]]; then + # If the chart uses relative path, drop the "/index.yaml" + # from the repo_url and append the relative path + repo=$(echo "$repo_url" | sed 's/\/index\.yaml//') + dep_url="${repo}/${dep_url}" fi + if [[ -z "$dep_url" ]]; then + echo "❌ Dependency URL is empty." + echo "Make sure the version is correct and the dependency exists in the index." + echo "Aborting..." + exit 1 + fi + + echo "🔗 Dependency URL: $dep_url" + echo "" echo "⏬ Downloading dependency $name-$version from $dep_url..." mkdir -p "$cache_path/$repo_dir"