Adding in droplet tags on creation

This commit is contained in:
Mike Zupan 2018-07-30 07:52:40 -06:00
parent 07cafb80ec
commit 7081fe990b
2 changed files with 6 additions and 0 deletions

View File

@ -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
}

View File

@ -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)