diff --git a/install/install.sh b/install/install.sh index fff7815..7a1c25e 100644 --- a/install/install.sh +++ b/install/install.sh @@ -70,7 +70,13 @@ function helm_install_for_hango_component() { } function verify_hango_install() { - sleep 10 + jq -V > /dev/null 2>&1 + if [[ $? -ne 0 ]]; then + log "Unable to find jq command, skipping service readiness check." + return 0 + fi + sleep 1 + while true; do # 获取命名空间中所有的 Deployment 名称 DEPLOYMENTS="$(kubectl get deploy -n ${HANGO_NAMESPACE} -o jsonpath='{.items[*].metadata.name}')" @@ -87,18 +93,14 @@ function verify_hango_install() { # 判断 Deployment 是否就绪 if [[ ${AVAILABLE} -eq ${DESIRED} ]]; then echo "Deployment ${DEPLOYMENT_NAME} is ready." - else - echo "Deployment ${DEPLOYMENT_NAME} is not ready yet. Waiting..." - # 如果有任何一个 Deployment 不就绪,则退出循环 - continue 2 fi done # 所有的 Deployment 都就绪,退出循环 - echo "All deployments are ready." + echo "All deployments have been successfully created and are waiting for the Pods to be ready." break - sleep 5 + sleep 2 done } @@ -119,8 +121,8 @@ function main() { log "install finished!" log "start to verify hango install" verify_hango_install - log "hango verfied ok" - "${work_dir}"/init-hango/init.sh + sleep 1s + echo "Please create gateway manually (to use shell script install/init-hango/init.sh after the Pod is ready)" } # start installation process