File tree Expand file tree Collapse file tree
src/kubectl-helm-minikube Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212# Clean up
1313rm -rf /var/lib/apt/lists/*
1414
15+ # Fallback version when stable.txt cannot be fetched (updated: 2026-02)
16+ KUBECTL_FALLBACK_VERSION=" v1.28.0"
17+
1518KUBECTL_VERSION=" ${VERSION:- " latest" } "
1619HELM_VERSION=" ${HELM:- " latest" } "
1720MINIKUBE_VERSION=" ${MINIKUBE:- " latest" } " # latest is also valid
@@ -156,10 +159,8 @@ if [ ${KUBECTL_VERSION} != "none" ]; then
156159 if [ " ${KUBECTL_VERSION} " = " latest" ] || [ " ${KUBECTL_VERSION} " = " lts" ] || [ " ${KUBECTL_VERSION} " = " current" ] || [ " ${KUBECTL_VERSION} " = " stable" ]; then
157160 KUBECTL_VERSION=" $( curl -fsSL --connect-timeout 10 --max-time 30 https://dl.k8s.io/release/stable.txt 2> /dev/null | grep -E ' ^v[0-9]+\.[0-9]+\.[0-9]+' || echo " " ) "
158161 if [ -z " ${KUBECTL_VERSION} " ]; then
159- # Fallback to a known stable version when stable.txt cannot be fetched
160- # Note: This version should be updated periodically to a recent stable release
161- echo " (!) Failed to fetch kubectl stable version. Using fallback version v1.28.0"
162- KUBECTL_VERSION=" v1.28.0"
162+ echo " (!) Failed to fetch kubectl stable version. Using fallback version ${KUBECTL_FALLBACK_VERSION} "
163+ KUBECTL_VERSION=" ${KUBECTL_FALLBACK_VERSION} "
163164 fi
164165 else
165166 find_version_from_git_tags KUBECTL_VERSION https://github.com/kubernetes/kubernetes
You can’t perform that action at this time.
0 commit comments