mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Bundler: freeze lockfile on run, and "normalize" platform on plugin changes (#13015)
This PR enables the upgrade of bundler to the latest version. Prior to this PR, the ability to do so was blocked by bundler.setup in versions of bundler > `2.23` making runtime changes to `Gemfile.lock` (unless the lock file was `frozen`) based on the specific platform the application was being run on, overriding any platforms (including generic `java` platform) set during build time. This was in conflict with changes made in #12782, which prevented the logstash user writing to files in `/usr/share/logstash`. This PR will freeze the lockfile when logstash is run, and unfreeze it when manipulating plugins (install, update, remove, install from offline pack) to allow new plugins to be added. While unfrozen, changes are also made to ensure that the platform list remains as the generic `java` platform, and not changed to the specific platform for the runtime JVM. This PR also introduces a new runtime flag, `--enable-local-plugin-development`. This flag is intended for use by Logstash developers only, and enables a mode of operation where a Gemfile can be manipulated, eg ``` gem "logstash-integration-kafka", :path => '/users/developer/code/plugins/logstash-integration-kafka' ``` to facilitate quick and simple plugin testing. This PR also sets the `silence_root_warning` flag to avoid bundler printing out alarming looking warning messages when `sudo` is used. This warning message was concerning for users - it would be printed out during normal operation of `bin/logstash-plugin install/update/remove` when run under `sudo`, which is the expected mode of operation when logstash is installed to run as a service via rpm/deb packages. This PR also updates the vagrant based integration tests to ensure that Logstash still runs after plugin update/install/remove operations, fixes up some regular expressions that would cause test failures, and removes some dead code from tests. ## Release notes * Updated Bundler to latest version * Ensured that `Gemfile.lock` are appropriately frozen * Added new developer-only flag to facilitate local plugin development to allow unfrozen lockfile in a development environment
This commit is contained in:
parent
771844c070
commit
4707cbd94c
28 changed files with 207 additions and 82 deletions
|
@ -54,7 +54,7 @@ class LogStash::PluginManager::Remove < LogStash::PluginManager::Command
|
|||
signal_error("This plugin has not been previously installed") unless LogStash::PluginManager.installed_plugin?(plugin, gemfile)
|
||||
|
||||
exit(1) unless ::Bundler::LogstashUninstall.uninstall!(plugin)
|
||||
|
||||
LogStash::Bundler.genericize_platform
|
||||
remove_unused_locally_installed_gems!
|
||||
rescue => exception
|
||||
report_exception("Operation aborted, cannot remove plugin", exception)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue