Skip to content

Commit

Permalink
Updates version selection logic
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Jan 13, 2024
1 parent 6df16df commit 7d7db74
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
16 changes: 6 additions & 10 deletions helpers/personalized_search_ranking_quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,13 @@ if [ -n "${VOLUME_NAME:-}" ]; then
fi
echo "Volume created"


# Starting in 2.12.0, security demo configuration script requires an initial admin password
IFS='.' read -ra version_array <<< "$VERSION"

if [ -z "$CREDENTIAL" ]
then
if (( ${version_array[0]} > 2 || (${version_array[0]} == 2 && ${version_array[1]} >= 12) )); then
CREDENTIAL="admin:myStrongPassword123!"
else
CREDENTIAL="admin:admin"
fi
OPENSEARCH_REQUIRED_VERSION="2.12.0"
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $OPENSEARCH_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
OPENSEARCH_INITIAL_ADMIN_PASSWORD="admin"
else
OPENSEARCH_INITIAL_ADMIN_PASSWORD="myStrongPassword123!"
fi

#
Expand Down
15 changes: 6 additions & 9 deletions helpers/search_processing_kendra_quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,12 @@ if [ -n "${VOLUME_NAME:-}" ]; then
fi

# Starting in 2.12.0, security demo configuration script requires an initial admin password
IFS='.' read -ra version_array <<< "$VERSION"

if [ -z "$CREDENTIAL" ]
then
if (( ${version_array[0]} > 2 || (${version_array[0]} == 2 && ${version_array[1]} >= 12) )); then
CREDENTIAL="admin:myStrongPassword123!"
else
CREDENTIAL="admin:admin"
fi
OPENSEARCH_REQUIRED_VERSION="2.12.0"
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $OPENSEARCH_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
OPENSEARCH_INITIAL_ADMIN_PASSWORD="admin"
else
OPENSEARCH_INITIAL_ADMIN_PASSWORD="myStrongPassword123!"
fi


Expand Down

0 comments on commit 7d7db74

Please sign in to comment.