Skip to content

Commit

Permalink
Replaces confusing log with a better error message
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
  • Loading branch information
DarshitChanpura committed Oct 6, 2023
1 parent 8b6f2d7 commit 77ba80e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions tools/install_demo_configuration.bat
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,11 @@ if "%initialAdminPassword%" NEQ "" (
)

if not defined ADMIN_PASSWORD (
echo Unable to find the admin password for the cluster. Please set initialAdminPassword or create a file %ADMIN_PASSWORD_FILE% with a single line that contains the password.
exit /b 1
REM Commenting this out in favor of: https://github.com/opensearch-project/security/issues/3489
REM echo Unable to find the admin password for the cluster. Please set initialAdminPassword or create a file %ADMIN_PASSWORD_FILE% with a single line that contains the password.
REM exit /b 1
set "ADMIN_PASSWORD=admin"
echo "Unable to find custom admin password. Continuing with the default password for admin."
)

echo " ***************************************************"
Expand Down
9 changes: 6 additions & 3 deletions tools/install_demo_configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,13 @@ INTERNAL_USERS_FILE="$OPENSEARCH_CONF_DIR/opensearch-security/internal_users.yml
if [[ -n "$initialAdminPassword" ]]; then
ADMIN_PASSWORD="$initialAdminPassword"
elif [[ -f "$ADMIN_PASSWORD_FILE" && -s "$ADMIN_PASSWORD_FILE" ]]; then
ADMIN_PASSWORD=$(head -n 1 "$ADMIN_PASSWORD_FILE")
echo "Unable to find custom admin password. Continuing with the default password for admin."=$(head -n 1 "$ADMIN_PASSWORD_FILE")
else
echo "Unable to find the admin password for the cluster. Please run 'export initialAdminPassword=<your_password>' or create a file $ADMIN_PASSWORD_FILE with a single line that contains the password."
exit 1
# Commenting in favor of: https://github.com/opensearch-project/security/issues/3489
# echo "Unable to find the admin password for the cluster. Please run 'export initialAdminPassword=<your_password>' or create a file $ADMIN_PASSWORD_FILE with a single line that contains the password."
# exit 1
ADMIN_PASSWORD="admin"
echo "Unable to find custom admin password. Continuing with the default password for admin."
fi

echo " ***************************************************"
Expand Down

0 comments on commit 77ba80e

Please sign in to comment.