From fd2a3a2f8c3130dfe56d51ed3ec3fe80bbc579ce Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Wed, 30 Oct 2024 23:51:47 -0400 Subject: [PATCH] Update default credential logic Signed-off-by: Craig Perkins --- scripts/integtest.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/integtest.sh b/scripts/integtest.sh index 98ee40fbd6..15b446ff24 100644 --- a/scripts/integtest.sh +++ b/scripts/integtest.sh @@ -89,9 +89,16 @@ then CREDENTIAL="admin:admin" fi +OPENSEARCH_REQUIRED_VERSION="2.12.0" if [ -z "$CREDENTIAL" ] then - CREDENTIAL="admin:admin" + # Starting in 2.12.0, security demo configuration script requires an initial admin password + 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:myStrongPassword123!" + fi fi if [ -z "$CLUSTER_NAME" ]