diff --git a/builder/digitalocean/config.go b/builder/digitalocean/config.go index 6e58bc759..f2f389b7a 100644 --- a/builder/digitalocean/config.go +++ b/builder/digitalocean/config.go @@ -35,6 +35,7 @@ type Config struct { DropletName string `mapstructure:"droplet_name"` UserData string `mapstructure:"user_data"` UserDataFile string `mapstructure:"user_data_file"` + RunTags []string `mapstructure:"run_tags"` ctx interpolate.Context } @@ -121,6 +122,10 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { } } + if c.RunTags == nil { + c.RunTags = make([]string, 0) + } + if errs != nil && len(errs.Errors) > 0 { return nil, nil, errs } diff --git a/builder/digitalocean/step_create_droplet.go b/builder/digitalocean/step_create_droplet.go index d9c8976bf..a67e28e79 100644 --- a/builder/digitalocean/step_create_droplet.go +++ b/builder/digitalocean/step_create_droplet.go @@ -49,6 +49,7 @@ func (s *stepCreateDroplet) Run(_ context.Context, state multistep.StateBag) mul Monitoring: c.Monitoring, IPv6: c.IPv6, UserData: userData, + Tags: c.RunTags, }) if err != nil { err := fmt.Errorf("Error creating droplet: %s", err)