Skip to content

Commit

Permalink
fix: Remove the screen flashing prompt in install.sh and add check fo…
Browse files Browse the repository at this point in the history
…r the existence of the jq command. (#64)

Signed-off-by: yutao04 <[email protected]>
  • Loading branch information
trickMin authored Sep 21, 2023
1 parent 601baac commit d5f1a96
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}')"
Expand All @@ -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
}

Expand All @@ -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
Expand Down

0 comments on commit d5f1a96

Please sign in to comment.