From de03a24da3aaa8cc21dad6e69ebb37f5bfa0c190 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 24 Jan 2020 15:51:32 -0500 Subject: [PATCH] Simplify plugin install in test clusters (#51441) 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. --- .../testclusters/ElasticsearchNode.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index 0ed6e0ebdf71f..3ea3785e8db29 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -428,27 +428,17 @@ public synchronized void start() { createConfiguration(); - final List 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) {