fix: detect mounted kubectl first, skip download
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5s
This commit is contained in:
parent
c6d5a1c935
commit
7601ca5443
@ -70,15 +70,14 @@ jobs:
|
||||
|
||||
- name: Setup Kubectl
|
||||
run: |
|
||||
if ! command -v kubectl &>/dev/null; then
|
||||
echo "kubectl not found, using mounted binary or downloading..."
|
||||
if [ -f /usr/local/bin/kubectl ]; then
|
||||
echo "kubectl found at /usr/local/bin/kubectl"
|
||||
echo "Using mounted kubectl"
|
||||
elif command -v kubectl &>/dev/null; then
|
||||
echo "kubectl already in PATH"
|
||||
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
|
||||
echo "Downloading kubectl..."
|
||||
curl -sLO "https://dl.k8s.io/release/v1.28.0/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl && mv kubectl /usr/local/bin/kubectl
|
||||
fi
|
||||
kubectl version --client
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user