Skip to content

[Bug]🐛 a plugin installed with --version is skipped when updating #17196

Closed
@yaauie

Description

@yaauie

Logstash information:

Please include the following information:

  1. Logstash version (e.g. bin/logstash --version): 2.x...main
  2. Logstash installation source (e.g. built from source, with a package manager: DEB/RPM, expanded from tar or zip archive, docker): any
  3. 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:

  1. Install a specific version of a plugin (e.g., logstash-filter-qatest version 0.1.0)
    bin/logstash-plugin install --version 0.1.0 logstash-filter-qatest
  2. Observe that a newer version 0.1.1 of the plugin is available on rubygems.
  3. 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
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions