mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-08 16:22:15 -04:00
Implemented DEFAULT_NAME handling for datasource plugins (#11026)
This commit is contained in:
parent
b6db1ac319
commit
6867456a72
1 changed files with 5 additions and 1 deletions
|
|
@ -320,7 +320,11 @@ func (c *PluginConfig) DiscoverMultiPlugin(pluginName, pluginPath string) error
|
|||
|
||||
for _, datasourceName := range desc.Datasources {
|
||||
datasourceName := datasourceName // copy to avoid pointer overwrite issue
|
||||
c.DataSources.Set(pluginPrefix+datasourceName, func() (packersdk.Datasource, error) {
|
||||
key := pluginPrefix + datasourceName
|
||||
if datasourceName == pluginsdk.DEFAULT_NAME {
|
||||
key = pluginName
|
||||
}
|
||||
c.DataSources.Set(key, func() (packersdk.Datasource, error) {
|
||||
return c.Client(pluginPath, "start", "datasource", datasourceName).Datasource()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue