Skip to content

Commit

Permalink
Updates credentials to be admin
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura authored and ankitkala committed Feb 9, 2024
1 parent 581cff0 commit 2612f57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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", "")
Expand Down Expand Up @@ -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)
}

Expand Down
10 changes: 9 additions & 1 deletion scripts/integtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`
Expand Down

0 comments on commit 2612f57

Please sign in to comment.