mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Adapted install/uninstall/list PluginManager's command to respect the alised plugins (#12821)
Adapted install/uninstall/list PluginManager's CLI commands to respect the alised plugins - adapt install plugin to resolve an alias giving precedence on a real plugin - changed list to mark alised plugins - uninstall avoid to remove the alias and ask the user to remove the original plugin - update update the original plugin in case of alias, else fallback on usual behavior Co-authored-by: Ry Biesemeyer <ry.biesemeyer@elastic.co>
This commit is contained in:
parent
5e7759767a
commit
1e08341e1e
5 changed files with 55 additions and 3 deletions
|
@ -32,6 +32,14 @@ class LogStash::PluginManager::Remove < LogStash::PluginManager::Command
|
|||
##
|
||||
LogStash::Bundler.setup!({:without => [:build, :development]})
|
||||
|
||||
if LogStash::PluginManager::ALIASES.has_key?(plugin)
|
||||
unless LogStash::PluginManager.installed_plugin?(plugin, gemfile)
|
||||
aliased_plugin = LogStash::PluginManager::ALIASES[plugin]
|
||||
puts "Cannot remove the alias #{plugin}, which is an alias for #{aliased_plugin}; if you wish to remove it, you must remove the aliased plugin instead."
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
# If a user is attempting to uninstall X-Pack, present helpful output to guide
|
||||
# them toward the OSS-only distribution of Logstash
|
||||
LogStash::PluginManager::XPackInterceptor::Remove.intercept!(plugin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue