Skip to content

Commit

Permalink
plugin: use API version for loading plugins
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lbajolet-hashicorp committed Feb 23, 2024
1 parent ed03264 commit bf1895d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packer/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()},
},
Expand Down

0 comments on commit bf1895d

Please sign in to comment.