debug actions
Some checks failed
Build NGINX on Ubuntu / build-and-push (push) Successful in 1m23s
Build NGINX on Ubuntu / deploy-to-kubernetes (push) Failing after 6m56s

This commit is contained in:
huangzhiqiang 2025-06-09 12:19:28 +08:00
parent c62073be32
commit 8e6f967173

View File

@ -185,12 +185,14 @@ jobs:
- name: 安装 kubectl
run: |
echo "当前工作目录: $(pwd)"
echo "检查并安装 kubectl..."
# 先检查本地是否已有 kubectl
if command -v kubectl &> /dev/null; then
echo "kubectl 已存在,当前版本: $(kubectl version --client --short 2>/dev/null || kubectl version --client)"
else
# 检查仓库中是否有 kubectl
ls -al k8s/kubectl
if [ -f "k8s/kubectl" ] && [ -x "k8s/kubectl" ]; then
echo "使用仓库中的 kubectl..."
sudo mv k8s/kubectl /usr/local/bin/
@ -230,7 +232,7 @@ jobs:
# 验证 kubectl 连接
echo "验证 Kubernetes 集群连接..."
if kubectl cluster-info --short; then
if kubectl cluster-info ; then
echo "Kubernetes 集群连接成功"
else
echo "ERROR: 无法连接到 Kubernetes 集群"