Closed
Description
Logstash information:
Please include the following information:
- Logstash version (e.g.
bin/logstash --version
):2.x
...main
- Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker): any
- How is Logstash being run (e.g. as a service/service manager: systemd, upstart, etc. Via command line, docker/kubernetes): any
Plugins installed: (bin/logstash-plugin list --verbose
)
n/a
JVM (e.g. java -version
):
n/a
OS version (uname -a
if on a Unix-like system): all
Description of the problem including expected versus actual behavior:
When a plugin is installed with bin/logstash-plugin install
using the --version
flag, that plugin is not updated in subsequent invocations of bin/logstash-plugin update
Steps to reproduce:
- Install a specific version of a plugin (e.g.,
logstash-filter-qatest
version0.1.0
)bin/logstash-plugin install --version 0.1.0 logstash-filter-qatest
- Observe that a newer version
0.1.1
of the plugin is available on rubygems. - Invoke the plugin manager's update command, specifically telling it to update said gem and noting that the version stays the same:
bin/logstash-plugin update logstash-filter-qatest
- Observe that the plugin was not updated:
bin/logstash-plugin list --verbose logstash-filter-qatest
The issue appears to be in the plugin manager's LogStash::Gemset#update_gem
.
- The plugin manager's Update command attempts to update the gemfile to remove the version constraints (source)
- But
LogStash::Gemset#update_gem
only applies the inbound version constraints if they are non-empty (source)
Since #16899 (8.16, 9.0), we rely the --major
, --minor
,--patch
flags for bundler to control updates relative to the lockfile, so it is always safe to remove the requirement of an already-installed gem.