From 55fd95651ad73e814863c6f025bae8a988c48b56 Mon Sep 17 00:00:00 2001 From: bhumi46 Date: Mon, 2 Dec 2024 12:23:46 +0530 Subject: [PATCH] [DSD-6742] fixed script for es-dev env Signed-off-by: bhumi46 --- deploy/mock-relying-party-ui/install.sh | 13 +++++++------ deploy/postgres/generate-secret-cm.py | 2 +- deploy/postgres/init_db.sh | 2 +- deploy/postgres/init_values.yaml | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/deploy/mock-relying-party-ui/install.sh b/deploy/mock-relying-party-ui/install.sh index 2b25668f..bbcc0435 100755 --- a/deploy/mock-relying-party-ui/install.sh +++ b/deploy/mock-relying-party-ui/install.sh @@ -26,17 +26,18 @@ function installing_mock-relying-party-ui() { CHART_VERSION=0.10.0-develop read -p "Please provide mock relying party ui domain (eg: healthservices.sandbox.xyz.net ) : " MOCK_UI_HOST + MOCK_UI_HOST=$(echo "$MOCK_UI_HOST" | xargs) # Trim whitespace if [ -z "$MOCK_UI_HOST" ]; then echo "Mock relying party UI Host not provided; EXITING;" - exit 1; + exit 1 fi - CHK_MOCK_UI_HOST=$(nslookup "$MOCK_UI_HOST" > /dev/null 2>&1) - if [ $? -ne 0 ]; then - echo "Mock relying party UI Host does not exist; EXITING;" + # Check if the domain resolves successfully + nslookup "$MOCK_UI_HOST" > /dev/null 2>&1 || { + echo "Mock relying party UI Host does not exist; EXITING." exit 1 - fi - + } + echo Create $NS namespace kubectl create ns $NS || true diff --git a/deploy/postgres/generate-secret-cm.py b/deploy/postgres/generate-secret-cm.py index 8b1fec5b..a668ce75 100644 --- a/deploy/postgres/generate-secret-cm.py +++ b/deploy/postgres/generate-secret-cm.py @@ -91,7 +91,7 @@ def create_or_update_configmap(configmap_name, namespace, postgres_host, postgre create_or_update_secret(db_secret_name, namespace, "db-dbuser-password", password) # Handle postgres-password secret -postgres_secret_name = "esignet-postgres-postgresql" +postgres_secret_name = "postgres-postgresql" if secret_exists(postgres_secret_name, namespace): overwrite = input(f"Secret '{postgres_secret_name}' already exists in namespace '{namespace}'. Overwrite? (y/n): ") if overwrite.lower() == 'y': diff --git a/deploy/postgres/init_db.sh b/deploy/postgres/init_db.sh index b9626272..cfb53d62 100755 --- a/deploy/postgres/init_db.sh +++ b/deploy/postgres/init_db.sh @@ -35,7 +35,7 @@ while true; do kubectl -n $NS delete --ignore-not-found=true secret db-common-secrets echo Copy Postgres secrets - ../copy_cm_func.sh secret esignet-postgres-postgresql esignet $NS + ../copy_cm_func.sh secret postgres-postgresql esignet $NS echo Initializing DB helm -n $NS install postgres-init-mockidentitysystem mosip/postgres-init -f init_values.yaml \ diff --git a/deploy/postgres/init_values.yaml b/deploy/postgres/init_values.yaml index a6517da7..fd3d3710 100644 --- a/deploy/postgres/init_values.yaml +++ b/deploy/postgres/init_values.yaml @@ -9,7 +9,7 @@ databases: su: user: postgres secret: - name: esignet-postgres-postgresql + name: postgres-postgresql key: postgres-password dml: 1 branch: develop