From 08f4501e1b06af77489e62d0111a9d796c516783 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Wed, 14 Dec 2022 14:50:52 +0000 Subject: [PATCH] feat(init): Error only if the domain is empty in vars.yaml while upgrade (#884) 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 f1daa247a..90afd8918 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"