From a796997adae063ab0c8a80ab1b655d63762cf098 Mon Sep 17 00:00:00 2001 From: hanzlamateen Date: Thu, 2 Mar 2023 13:59:41 +0300 Subject: [PATCH] Fixes various issues in check engine script. --- scripts/check-engine.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/check-engine.sh b/scripts/check-engine.sh index 33bb601f4fa..5201ef1305c 100755 --- a/scripts/check-engine.sh +++ b/scripts/check-engine.sh @@ -1,13 +1,17 @@ +#!/bin/bash + apiName="${RELEASE_NAME}-xrengine-api" clientName="${RELEASE_NAME}-xrengine-client" instanceserverName="${RELEASE_NAME}-instanceserver" apiCount=$(kubectl get deploy $apiName -o jsonpath='{.status.availableReplicas}') +if [ -z "$apiCount" ]; then + apiCount=0 +fi echo "API ready count: $apiCount" # Wait until api count is 1. -until [ $apiCount -ge 1 ] -do +until [ "${apiCount}" -ge 1 ]; do sleep 5 apiCount=$(kubectl get deploy $apiName -o jsonpath='{.status.availableReplicas}') @@ -15,11 +19,13 @@ do done clientCount=$(kubectl get deploy $clientName -o jsonpath='{.status.availableReplicas}') +if [ -z "$clientCount" ]; then + clientCount=0 +fi echo "Client ready count: $clientCount" # Wait until client count is 1. -until [ $clientCount -ge 1 ] -do +until [ "${clientCount}" -ge 1 ]; do sleep 5 clientCount=$(kubectl get deploy $clientName -o jsonpath='{.status.availableReplicas}') @@ -27,11 +33,13 @@ do done instanceserverCount=$(kubectl get fleet $instanceserverName -o jsonpath='{.status.readyReplicas}') +if [ -z "$instanceserverCount" ]; then + instanceserverCount=0 +fi echo "Instanceserver ready count: $instanceserverCount" # Wait until instanceserver count is 1. -until [ $instanceserverCount -ge 1 ] -do +until [ "${instanceserverCount}" -ge 1 ]; do sleep 5 instanceserverCount=$(kubectl get fleet $instanceserverName -o jsonpath='{.status.readyReplicas}')