builder/digitalocean: Adhere to new interface, make default in Packer
@pearkes: I added "digital-ocean" to the default config since it will be shipping with Packer. :)
This commit is contained in:
parent
a76a9e86fc
commit
03d7a7f6b5
|
@ -42,9 +42,12 @@ type Builder struct {
|
|||
runner multistep.Runner
|
||||
}
|
||||
|
||||
func (b *Builder) Prepare(raw interface{}) error {
|
||||
if err := mapstructure.Decode(raw, &b.config); err != nil {
|
||||
return err
|
||||
func (b *Builder) Prepare(raws ...interface{}) error {
|
||||
for _, raw := range raws {
|
||||
err := mapstructure.Decode(raw, &b.config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Optional configuration with defaults
|
||||
|
|
|
@ -18,6 +18,7 @@ const defaultConfig = `
|
|||
|
||||
"builders": {
|
||||
"amazon-ebs": "packer-builder-amazon-ebs",
|
||||
"digital-ocean": "packer-builder-digital-ocean",
|
||||
"virtualbox": "packer-builder-virtualbox",
|
||||
"vmware": "packer-builder-vmware"
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"github.com/mitchellh/packer/packer/plugin"
|
||||
"github.com/pearkes/packer/builder/digitalocean"
|
||||
"github.com/mitchellh/packer/builder/digitalocean"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
Loading…
Reference in New Issue