Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Improve messaging on how to set initial admin password #3918

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ void updateAdminPassword() {

// if ADMIN_PASSWORD is still an empty string, it implies no custom password was provided. We exit the setup.
if (Strings.isNullOrEmpty(ADMIN_PASSWORD)) {
System.out.println("No custom admin password found. Please provide a password.");
System.out.println(
String.format(
"No custom admin password found. Please provide a password via the environment variable %s.",
ConfigConstants.OPENSEARCH_INITIAL_ADMIN_PASSWORD
)
);
System.exit(-1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ public void testUpdateAdminPassword_noPasswordSupplied() {
System.setSecurityManager(null);
}

verifyStdOutContainsString("No custom admin password found. Please provide a password.");
verifyStdOutContainsString(
String.format(
"No custom admin password found. Please provide a password via the environment variable %s.",
ConfigConstants.OPENSEARCH_INITIAL_ADMIN_PASSWORD
)
);
}

@Test
Expand Down
Loading