Fix warning when installing a plugin for different ESversion (#66146)

This commit change the warn message returned by elasticsearch-plugin list. The elasticsearch version of plugin is needed for comparison with current es version rather than the plugin version.
This commit is contained in:
Fan Jingbo 2020-12-15 00:18:55 +08:00 committed by GitHub
parent 3406422336
commit 2bf5c79b89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -70,7 +70,7 @@ class ListPluginsCommand extends EnvironmentAwareCommand {
"WARNING: plugin ["
+ info.getName()
+ "] was built for Elasticsearch version "
+ info.getVersion()
+ info.getElasticsearchVersion()
+ " but version "
+ Version.CURRENT
+ " is required"

View file

@ -266,7 +266,7 @@ public class ListPluginsCommandTests extends ESTestCase {
buildFakePlugin(env, "fake desc 2", "fake_plugin2", "org.fake2");
MockTerminal terminal = listPlugins(home);
String message = "plugin [fake_plugin1] was built for Elasticsearch version 1.0 but version " + Version.CURRENT + " is required";
String message = "plugin [fake_plugin1] was built for Elasticsearch version 1.0.0 but version " + Version.CURRENT + " is required";
assertEquals("fake_plugin1\nfake_plugin2\n", terminal.getOutput());
assertEquals("WARNING: " + message + "\n", terminal.getErrorOutput());