fix: use mounted kubectl, fallback to official dl.k8s.io
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
parent
b8ecaf44d0
commit
c6d5a1c935
@ -71,11 +71,14 @@ jobs:
|
||||
- name: Setup Kubectl
|
||||
run: |
|
||||
if ! command -v kubectl &>/dev/null; then
|
||||
for attempt in 1 2 3; do
|
||||
curl -LO "https://files.m.daocloud.io/dl.k8s.io/release/v1.28.0/bin/linux/amd64/kubectl" && break
|
||||
echo "Download attempt $attempt failed, retrying in 5s..." && sleep 5
|
||||
done
|
||||
chmod +x kubectl && mv kubectl /usr/bin/kubectl
|
||||
echo "kubectl not found, using mounted binary or downloading..."
|
||||
if [ -f /usr/local/bin/kubectl ]; then
|
||||
echo "kubectl found at /usr/local/bin/kubectl"
|
||||
else
|
||||
curl -LO "https://dl.k8s.io/release/v1.28.0/bin/linux/amd64/kubectl" || \
|
||||
curl -LO "https://files.m.daocloud.io/dl.k8s.io/release/v1.28.0/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl && mv kubectl /usr/bin/kubectl
|
||||
fi
|
||||
fi
|
||||
kubectl version --client
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user