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 <dchanp@amazon.com>
  • Loading branch information
DarshitChanpura committed Jan 13, 2024
1 parent 6df16df commit 09e4d38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions helpers/personalized_search_ranking_quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,18 @@ 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!"
# Starting in 2.12.0, security demo configuration script requires an initial admin password
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
CREDENTIAL="admin:admin"
else
CREDENTIAL="admin:admin"
CREDENTIAL="admin:myStrongPassword123!"
fi
fi
fi

#
# Create a docker-compose.yml file that will launch an OpenSearch node with the image we
Expand Down
13 changes: 7 additions & 6 deletions helpers/search_processing_kendra_quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,18 @@ if [ -n "${VOLUME_NAME:-}" ]; then
external: true"
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!"
# Starting in 2.12.0, security demo configuration script requires an initial admin password
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
CREDENTIAL="admin:admin"
else
CREDENTIAL="admin:admin"
CREDENTIAL="admin:myStrongPassword123!"
fi
fi
fi


#
Expand Down

0 comments on commit 09e4d38

Please sign in to comment.