From f616955ebcb6a05412a7bf8912282f1e6b56c446 Mon Sep 17 00:00:00 2001 From: Sylvia Moss Date: Mon, 8 Feb 2021 13:58:35 +0100 Subject: [PATCH] Fix issue when loading datasource single plugin type (#10589) --- packer/plugin.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packer/plugin.go b/packer/plugin.go index 58d1c7891..8f7397934 100644 --- a/packer/plugin.go +++ b/packer/plugin.go @@ -172,7 +172,9 @@ func (c *PluginConfig) discoverExternalComponents(path string) error { } for pluginName, pluginPath := range pluginPaths { newPath := pluginPath // this needs to be stored in a new variable for the func below - c.DataSources.Set(pluginName, c.Client(newPath).Datasource) + c.DataSources.Set(pluginName, func() (packersdk.Datasource, error) { + return c.Client(newPath).Datasource() + }) externallyUsed = append(externallyUsed, pluginName) } if len(externallyUsed) > 0 {