packer: don't load plugins with metadata in name

If a plugin is installed in the PACKER_PLUGIN_PATH, and its version
contains metadata, we reject it. This is because metadata is free-form
data, which could then make it possible to have multiple conflicting
versions of a plugin installed, so we don't support it and explicitely
reject plugins like those.

A valid plugin with metadata in its version information should be
installed without its metadata part, so there can only be one variant of
the plugin installed at a specific version.
pull/12984/head
Lucas Bajolet 2 years ago committed by Wilken Rivera
parent e161367e28
commit 682968d0df

@ -280,6 +280,11 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL
continue
}
if ver.Metadata() != "" {
log.Printf("found version %q with metadata in the name, this could introduce ambiguity and is not supported, ignoring it.", pluginVersionStr)
continue
}
descVersion, err := goversion.NewVersion(describeInfo.Version)
if err != nil {
log.Printf("malformed reported version string %q: %s, ignoring", describeInfo.Version, err)

Loading…
Cancel
Save