Skip to content

Commit

Permalink
Simplify plugin install in test clusters (#51441)
Browse files Browse the repository at this point in the history
This commit simplifies the plugin installation in test clusters by
removing some legacy code against 6.x that is not needed when starting
clusters in 8.0.0.
  • Loading branch information
jasontedor authored Jan 24, 2020
1 parent b034d1e commit de03a24
Showing 1 changed file with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,27 +428,17 @@ public synchronized void start() {

createConfiguration();

final List<String> pluginsToInstall = new ArrayList<>();
if (plugins.isEmpty() == false) {
pluginsToInstall.addAll(plugins.stream().map(URI::toString).collect(Collectors.toList()));
}

if (getVersion().before("6.3.0") && testDistribution == TestDistribution.DEFAULT) {
logToProcessStdout("emulating the " + testDistribution + " flavor for " + getVersion() + " by installing x-pack");
pluginsToInstall.add("x-pack");
}

if (pluginsToInstall.isEmpty() == false) {
if (getVersion().onOrAfter("7.6.0")) {
logToProcessStdout("installing " + pluginsToInstall.size() + " plugins in a single transaction");
final String[] arguments = Stream.concat(Stream.of("install", "--batch"), pluginsToInstall.stream()).toArray(String[]::new);
logToProcessStdout("installing " + plugins.size() + " plugins in a single transaction");
final String[] arguments = Stream.concat(Stream.of("install", "--batch"), plugins.stream().map(URI::toString))
.toArray(String[]::new);
runElasticsearchBinScript("elasticsearch-plugin", arguments);
logToProcessStdout("installed plugins");
} else {
logToProcessStdout("installing " + pluginsToInstall.size() + " plugins sequentially");
pluginsToInstall.forEach(plugin -> runElasticsearchBinScript("elasticsearch-plugin", "install", "--batch", plugin));
logToProcessStdout("installed plugins");
logToProcessStdout("installing " + plugins.size() + " plugins sequentially");
plugins.forEach(plugin -> runElasticsearchBinScript("elasticsearch-plugin", "install", "--batch", plugin.toString()));
}
logToProcessStdout("installed plugins");
}

if (keystoreSettings.isEmpty() == false || keystoreFiles.isEmpty() == false) {
Expand Down

0 comments on commit de03a24

Please sign in to comment.