From c56b939b8ede45941a6e8f6848c7a8e31dd82b5a Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Wed, 14 Dec 2022 15:49:15 +0100 Subject: [PATCH] feat(init): Error only if the domain is empty in vars.yaml while upgrade Signed-off-by: rjshrjndrn --- scripts/helmcharts/init.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/helmcharts/init.sh b/scripts/helmcharts/init.sh index e3d043a12..58f70d982 100644 --- a/scripts/helmcharts/init.sh +++ b/scripts/helmcharts/init.sh @@ -32,7 +32,7 @@ function install_k8s() { # Checking whether the app exists or we do have to upgade. function exists() { install_status=Upgrading - [[ UPGRADE_TOOLS -eq 1 ]] && { + [[ $UPGRADE_TOOLS -eq 1 ]] && { install_status=Upgrading return 100 } @@ -112,8 +112,12 @@ function sed_i_wrapper(){ } function create_passwords() { - [[ -z $DOMAIN_NAME ]] && { - fatal 'DOMAIN_NAME variable is empty. Rerun the script `DOMAIN_NAME=openreplay.mycomp.org bash init.sh `' + # Error out only if the domain name is empty in vars.yaml + existing_domain_name=`grep domainName vars.yaml | awk '{print $2}' | xargs` + [[ -z $existing_domain_name ]] && { + [[ -z $DOMAIN_NAME ]] && { + fatal 'DOMAIN_NAME variable is empty. Rerun the script `DOMAIN_NAME=openreplay.mycomp.org bash init.sh `' + } } info "Creating dynamic passwords"