Skip to content

Commit

Permalink
#1671 Allows passing the opensearch user, password and indexname by c…
Browse files Browse the repository at this point in the history
…ommand line, env vars or system properties. This behavior is similar to the one used in the MinIOTask
  • Loading branch information
hauck-jvsh committed May 2, 2023
1 parent 0b97add commit 6f5bb7f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ public void init(ConfigurationManager configurationManager) throws Exception {
}

CmdLineArgs args = (CmdLineArgs) caseData.getCaseObject(CmdLineArgs.class.getName());
String cmdFields = args.getExtraParams().get(CMD_FIELDS_KEY);
if (cmdFields != null) {
parseCmdLineFields(cmdFields);
}

parseCmdLineFields(System.getenv(CMD_FIELDS_KEY));
parseCmdLineFields(System.getProperty(CMD_FIELDS_KEY));
parseCmdLineFields(args.getExtraParams().get(CMD_FIELDS_KEY));

if (indexName == null) {
indexName = output.getParentFile().getName();
Expand Down Expand Up @@ -201,6 +201,8 @@ public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpCli
}

private void parseCmdLineFields(String cmdFields) {
if(cmdFields==null)
return;
String[] entries = cmdFields.split(";");
for (String entry : entries) {
String[] pair = entry.split(":", 2);
Expand Down

0 comments on commit 6f5bb7f

Please sign in to comment.