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 authored and lfcnassif committed Jun 27, 2023
1 parent 6e2bc57 commit d5fcac7
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 d5fcac7

Please sign in to comment.