From 2612f572b7c6a91b93a89298d4ef3105574bcab8 Mon Sep 17 00:00:00 2001 From: Darshit Chanpura Date: Mon, 5 Feb 2024 13:39:53 -0500 Subject: [PATCH] Updates credentials to be admin Signed-off-by: Darshit Chanpura --- build.gradle | 3 +-- scripts/integtest.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e7dbd2c5..40819857 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,6 @@ import org.opensearch.gradle.test.RestIntegTestTask buildscript { ext { - System.setProperty("OPENSEARCH_INITIAL_ADMIN_PASSWORD", "myStrongPassword123!") isSnapshot = "true" == System.getProperty("build.snapshot", "true") opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT") buildVersionQualifier = System.getProperty("build.version_qualifier", "") @@ -429,7 +428,7 @@ def configureCluster(OpenSearchCluster cluster, Boolean securityEnabled) { } CrossClusterWaitForHttpResource wait = new CrossClusterWaitForHttpResource(protocol, cluster.getFirstNode().getHttpSocketURI(), cluster.nodes.size()) wait.setUsername("admin") - wait.setPassword(System.getProperty("OPENSEARCH_INITIAL_ADMIN_PASSWORD")) + wait.setPassword("admin") return wait.wait(500) } diff --git a/scripts/integtest.sh b/scripts/integtest.sh index 39d94c73..0d64d05a 100644 --- a/scripts/integtest.sh +++ b/scripts/integtest.sh @@ -70,9 +70,17 @@ then SECURITY_ENABLED="true" fi +OPENSEARCH_REQUIRED_VERSION="2.12.0" + if [ -z "$CREDENTIAL" ] then - CREDENTIAL="admin:admin" # CCR uses custom setup and hence doesn't require custom password + # 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 USERNAME=`echo $CREDENTIAL | awk -F ':' '{print $1}'`