fix: kubectl和kubeconfig对齐DevPerf项目写法
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m46s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m46s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6effb94e28
commit
5ec95e2d48
@ -70,12 +70,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
|
||||
if [ -f /usr/local/bin/kubectl ]; then
|
||||
echo "Using mounted kubectl"
|
||||
elif command -v kubectl &>/dev/null; then
|
||||
echo "kubectl already in PATH"
|
||||
else
|
||||
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
|
||||
|
||||
@ -86,6 +88,7 @@ jobs:
|
||||
chmod 600 $HOME/.kube/config
|
||||
echo "kubeconfig lines: $(wc -l < $HOME/.kube/config)"
|
||||
grep server $HOME/.kube/config || echo "WARNING: no server found in kubeconfig"
|
||||
kubectl cluster-info 2>&1 | head -3 || true
|
||||
|
||||
- name: Deploy to K3s
|
||||
id: deploy
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user