plugin: use API version for loading plugins

While migrating to a unified approach for loading plugins, the API
major and minor versions were not added to the constraints for
discovering plugins from the environment, leading to Packer potentially
considering plugins that are not compatible with itself.

This should not be possible, but was due to this omission, which we fix
with this commit.
pull/12863/head
Lucas Bajolet 2 years ago committed by Lucas Bajolet
parent 7113dea5ef
commit 525b0a7c4c

@ -77,8 +77,10 @@ func (c *PluginConfig) Discover() error {
installations, err := plugingetter.Requirement{}.ListInstallations(plugingetter.ListInstallationsOptions{
PluginDirectory: c.PluginDirectory,
BinaryInstallationOptions: plugingetter.BinaryInstallationOptions{
OS: runtime.GOOS,
ARCH: runtime.GOARCH,
OS: runtime.GOOS,
ARCH: runtime.GOARCH,
APIVersionMajor: pluginsdk.APIVersionMajor,
APIVersionMinor: pluginsdk.APIVersionMinor,
Checksummers: []plugingetter.Checksummer{
{Type: "sha256", Hash: sha256.New()},
},

Loading…
Cancel
Save