Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4380 from TheYorkshireDev/4227-DropletMonitoring
Browse files Browse the repository at this point in the history
Add monitoring flag for Digital Ocean droplets
  • Loading branch information
dgageot authored Feb 6, 2018
2 parents d9615a5 + cee1891 commit d8b1195
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Driver struct {
Backups bool
PrivateNetworking bool
UserDataFile string
Monitoring bool
Tags string
}

Expand Down Expand Up @@ -115,6 +116,11 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
Name: "digitalocean-userdata",
Usage: "path to file with cloud-init user-data",
},
mcnflag.BoolFlag{
EnvVar: "DIGITALOCEAN_MONITORING",
Name: "digitalocean-monitoring",
Usage: "enable monitoring for droplet",
},
mcnflag.StringFlag{
EnvVar: "DIGITALOCEAN_TAGS",
Name: "digitalocean-tags",
Expand Down Expand Up @@ -157,6 +163,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.SSHPort = flags.Int("digitalocean-ssh-port")
d.SSHKeyFingerprint = flags.String("digitalocean-ssh-key-fingerprint")
d.SSHKey = flags.String("digitalocean-ssh-key-path")
d.Monitoring = flags.Bool("digitalocean-monitoring")
d.Tags = flags.String("digitalocean-tags")

d.SetSwarmConfigFromFlags(flags)
Expand Down Expand Up @@ -232,6 +239,7 @@ func (d *Driver) Create() error {
Backups: d.Backups,
UserData: userdata,
SSHKeys: []godo.DropletCreateSSHKey{{ID: d.SSHKeyID}},
Monitoring: d.Monitoring,
Tags: d.getTags(),
}

Expand Down

0 comments on commit d8b1195

Please sign in to comment.