From 3177a5413c8a6057c06c6d91564c12f9e636c7dc Mon Sep 17 00:00:00 2001 From: Tommy McNeely Date: Fri, 27 Dec 2019 16:09:53 -0700 Subject: [PATCH] Fix external plugins path was blank --- config.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/config.go b/config.go index f99761979..145a2fca5 100644 --- a/config.go +++ b/config.go @@ -131,10 +131,11 @@ func (c *config) discoverExternalComponents(path string) error { if err != nil { return err } - for plugin := range pluginPaths { + for plugin, path := range pluginPaths { plugin := plugin + path := path c.Builders[plugin] = func() (packer.Builder, error) { - return c.pluginClient(pluginPaths[plugin]).Builder() + return c.pluginClient(path).Builder() } externallyUsed = append(externallyUsed, plugin) } @@ -148,10 +149,11 @@ func (c *config) discoverExternalComponents(path string) error { if err != nil { return err } - for plugin := range pluginPaths { + for plugin, path := range pluginPaths { plugin := plugin + path := path c.PostProcessors[plugin] = func() (packer.PostProcessor, error) { - return c.pluginClient(pluginPaths[plugin]).PostProcessor() + return c.pluginClient(path).PostProcessor() } externallyUsed = append(externallyUsed, plugin) } @@ -165,10 +167,11 @@ func (c *config) discoverExternalComponents(path string) error { if err != nil { return err } - for plugin := range pluginPaths { + for plugin, path := range pluginPaths { plugin := plugin + path := path c.Provisioners[plugin] = func() (packer.Provisioner, error) { - return c.pluginClient(pluginPaths[plugin]).Provisioner() + return c.pluginClient(path).Provisioner() } externallyUsed = append(externallyUsed, plugin) }