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 @@ -154,8 +154,10 @@ if [ ${KUBECTL_VERSION} != "none" ]; then
154154 # Install the kubectl, verify checksum
155155 echo " Downloading kubectl..."
156156 if [ " ${KUBECTL_VERSION} " = " latest" ] || [ " ${KUBECTL_VERSION} " = " lts" ] || [ " ${KUBECTL_VERSION} " = " current" ] || [ " ${KUBECTL_VERSION} " = " stable" ]; then
157- KUBECTL_VERSION=" $( curl -fsSL --connect-timeout 10 --max-time 30 https://dl.k8s.io/release/stable.txt 2> /dev/null || echo " " ) "
157+ 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 " " ) "
158158 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
159161 echo " (!) Failed to fetch kubectl stable version. Using fallback version v1.28.0"
160162 KUBECTL_VERSION=" v1.28.0"
161163 fi
You can’t perform that action at this time.
0 commit comments