don't override builder/prov/pproc

This commit is contained in:
sylviamoss 2020-12-03 18:22:32 +01:00
parent 4f8a27be10
commit efa7ec7883
1 changed files with 10 additions and 3 deletions

View File

@ -37,9 +37,16 @@ func (c *Config) GetPlugins() (packer.MapOfBuilder, packer.MapOfProvisioner, pac
// Hence, the priority order is the reverse of the search order - i.e., the
// CWD has the highest priority.
func (c *Config) Discover() error {
c.builders = packer.MapOfBuilder{}
c.postProcessors = packer.MapOfPostProcessor{}
c.provisioners = packer.MapOfProvisioner{}
if c.builders == nil {
c.builders = packer.MapOfBuilder{}
}
if c.provisioners == nil {
c.provisioners = packer.MapOfProvisioner{}
}
if c.postProcessors == nil {
c.postProcessors = packer.MapOfPostProcessor{}
}
// If we are already inside a plugin process we should not need to
// discover anything.
if os.Getenv(MagicCookieKey) == MagicCookieValue {