Skip to content

Commit 9aab57c

Browse files
authored
Apply suggestions from code review
Co-authored-by: Benjamin Bartels <[email protected]>
1 parent 76ca4ee commit 9aab57c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/kubectl-helm-minikube/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ KUBECTL_MIRROR="${KUBECTL_MIRROR:-https://dl.k8s.io}"
2222
HELM_MIRROR="${HELM_MIRROR:-https://get.helm.sh}"
2323
MINIKUBE_MIRROR="${MINIKUBE_MIRROR:-https://storage.googleapis.com/minikube}"
2424
GITHUB_RELEASE_URL="${GITHUB_RELEASE_MIRROR:-https://github.com}"
25+
KUBECTL_GCS_MIRROR="${KUBECTL_GCS_MIRROR:-https://storage.googleapis.com/kubernetes-release}"
2526

2627
KUBECTL_SHA256="${KUBECTL_SHA256:-"automatic"}"
2728
HELM_SHA256="${HELM_SHA256:-"automatic"}"
@@ -174,7 +175,7 @@ if [ ${KUBECTL_VERSION} != "none" ]; then
174175
KUBECTL_VERSION="$(curl -fsSL --connect-timeout 10 --max-time 30 "${KUBECTL_MIRROR}/release/stable.txt" 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' || echo "")"
175176
if [ -z "${KUBECTL_VERSION}" ]; then
176177
echo "(!) Failed to fetch kubectl stable version from ${KUBECTL_MIRROR}, trying alternative URL..."
177-
KUBECTL_VERSION="$(curl -fsSL --connect-timeout 10 --max-time 30 https://storage.googleapis.com/kubernetes-release/release/stable.txt 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' || echo "")"
178+
KUBECTL_VERSION="$(curl -fsSL --connect-timeout 10 --max-time 30 "${KUBECTL_GCS_MIRROR}/release/stable.txt" 2>/dev/null | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' || echo "")"
178179
fi
179180
if [ -z "${KUBECTL_VERSION}" ]; then
180181
echo "(!) Failed to fetch kubectl stable version from both URLs. Using fallback version ${KUBECTL_FALLBACK_VERSION}"

src/terraform/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ SENTINEL_SHA256="${SENTINEL_SHA256:-"automatic"}"
2929
TFSEC_SHA256="${TFSEC_SHA256:-"automatic"}"
3030
TERRAFORM_DOCS_SHA256="${TERRAFORM_DOCS_SHA256:-"automatic"}"
3131
GITHUB_RELEASE_URL="${GITHUB_RELEASE_MIRROR:-https://github.com}"
32+
GITHUB_USERCONTENT_URL="${GITHUB_USERCONTENT_MIRROR:-https://raw.githubusercontent.com}"
3233

3334
HASHICORP_RELEASES_URL="https://releases.hashicorp.com"
3435
if [ -n "${CUSTOM_DOWNLOAD_SERVER}" ]; then
3536
HASHICORP_RELEASES_URL="${CUSTOM_DOWNLOAD_SERVER}"
3637
fi
3738

3839
TERRAFORM_GPG_KEY="72D7468F"
39-
TFLINT_GPG_KEY_URI="https://raw.githubusercontent.com/terraform-linters/tflint/v0.46.1/8CE69160EB3F2FE9.key"
40+
TFLINT_GPG_KEY_URI="${GITHUB_USERCONTENT_URL}/terraform-linters/tflint/v0.46.1/8CE69160EB3F2FE9.key"
4041
HASHICORP_KEY_URL="${HASHICORP_GPG_KEY_MIRROR:-https://keybase.io}/hashicorp/pgp_keys.asc"
4142
KEYSERVER_PROXY="${HTTPPROXY:-"${HTTP_PROXY:-""}"}"
4243

0 commit comments

Comments
 (0)