fix(cluster): 兼容 Worker 缩容后的空就绪状态

Kubernetes 在 Deployment 缩容为 0 后可能省略 status.readyReplicas;验收脚本将空值按 0 处理,避免在提交真实任务前误判失败。
This commit is contained in:
2026-07-29 17:05:59 +08:00
parent 39b1541fa1
commit a073c840ac
+3 -2
View File
@@ -46,8 +46,9 @@ done
[[ ${pod_count:-0} == 1 && ${process_role:-} == worker && ${pod_ready:-} == true ]]
[[ $(k3s kubectl get deployment easyai-api-ningbo -n easyai \
-o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="AI_GATEWAY_PROCESS_ROLE")].value}') == api ]]
[[ $(k3s kubectl get deployment easyai-worker-ningbo -n easyai \
-o jsonpath='{.status.readyReplicas}') == 0 ]]
ningbo_worker_ready=$(k3s kubectl get deployment easyai-worker-ningbo -n easyai \
-o jsonpath='{.status.readyReplicas}')
[[ ${ningbo_worker_ready:-0} -eq 0 ]]
curl -fsS http://10.77.0.1:31088/api/v1/readyz | grep -q '"ok":true'
curl -fsS http://10.77.0.2:31089/api/v1/readyz | grep -q '"ok":true'
REMOTE