Skip to content

Commit

Permalink
Add logic to support 'latest'
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
derek-ho committed Feb 27, 2024
1 parent 47ca8ff commit 24dde23
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/actions/opensearch/run.sh
Original file line number Diff line number Diff line change
@@ -59,11 +59,15 @@ else
# Starting in 2.12.0, security demo configuration script requires an initial admin password which is set to
# myStrongPassword123!
OPENSEARCH_REQUIRED_VERSION="2.12.0"
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $CLUSTER_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
CREDENTIAL="admin:admin"
else
if [ "$CLUSTER_VERSION" == "latest" ]; then
CREDENTIAL="admin:myStrongPassword123!"
else
COMPARE_VERSION=`echo $OPENSEARCH_REQUIRED_VERSION $CLUSTER_VERSION | tr ' ' '\n' | sort -V | uniq | head -n 1`
if [ "$COMPARE_VERSION" != "$OPENSEARCH_REQUIRED_VERSION" ]; then
CREDENTIAL="admin:admin"
else
CREDENTIAL="admin:myStrongPassword123!"
fi
fi
docker run \
--network cluster \

0 comments on commit 24dde23

Please sign in to comment.