diff --git a/README.md b/README.md index 99bdb6fe..5d218be3 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Options: --scaleway-name Assign a name [$SCALEWAY_NAME] --scaleway-organization Scaleway organization [$SCALEWAY_ORGANIZATION] --scaleway-token Scaleway token [$SCALEWAY_TOKEN] + --scaleway-volumes Attach additional volume (e.g., 50G) [$SCALEWAY_VOLUMES] --swarm Configure Machine with Swarm --swarm-addr addr to advertise for Swarm (default: detect and use the machine IP) --swarm-discovery Discovery service to use with Swarm @@ -132,15 +133,16 @@ $ curl --silent http://212.47.248.251 | head -n1 # you can also open your browse ## Options -|Option Name |Description |Default Value |required| -|----------------------------------------------------------------|-------------------|--------------|--------| -|``--scaleway-organization`` or ``$SCALEWAY_ORGANIZATION`` |Organization UUID |none |yes | -|``--scaleway-token`` or ``$SCALEWAY_TOKEN`` |Token UUID |none |yes | -|``--scaleway-name`` or ``$SCALEWAY_NAME`` |Server name |none |no | -|``--scaleway-commercial-type`` or ``$SCALEWAY_COMMERCIAL_TYPE`` |Commercial type |VC1S |no | -|``--scaleway-image`` or ``$SCALEWAY_IMAGE`` |Server image |ubuntu-xenial |no | -|``--scaleway-debug`` or ``$SCALEWAY_DEBUG`` |Toggle debugging |false |no | -|``--scaleway-ip`` or ``$SCALEWAY_IP`` |Server IP |"" |no | +|Option Name |Description |Default Value |required| +|----------------------------------------------------------------|-------------------------|--------------|--------| +|``--scaleway-organization`` or ``$SCALEWAY_ORGANIZATION`` |Organization UUID |none |yes | +|``--scaleway-token`` or ``$SCALEWAY_TOKEN`` |Token UUID |none |yes | +|``--scaleway-name`` or ``$SCALEWAY_NAME`` |Server name |none |no | +|``--scaleway-commercial-type`` or ``$SCALEWAY_COMMERCIAL_TYPE`` |Commercial type |VC1S |no | +|``--scaleway-image`` or ``$SCALEWAY_IMAGE`` |Server image |ubuntu-xenial |no | +|``--scaleway-debug`` or ``$SCALEWAY_DEBUG`` |Toggle debugging |false |no | +|``--scaleway-ip`` or ``$SCALEWAY_IP`` |Server IP |"" |no | +|``--scaleway-volumes`` or ``$SCALEWAY_VOLUMES`` |Attach additional volume |"" |no | --- @@ -148,7 +150,8 @@ $ curl --silent http://212.47.248.251 | head -n1 # you can also open your browse ### master (unreleased) -* Add `--scaleway-ip` ([#37](https://github.com/scaleway/docker-machine-driver-scaleway/issues/37)) +* Add `--scaleway-volumes` ([#37](https://github.com/scaleway/docker-machine-driver-scaleway/issues/37)) +* Add `--scaleway-ip` ([#40](https://github.com/scaleway/docker-machine-driver-scaleway/issues/40)) View full [commits list](https://github.com/scaleway/docker-machine-driver-scaleway/compare/v1.1.0...master) diff --git a/driver/scaleway.go b/driver/scaleway.go index 1d666e44..3a50cb37 100644 --- a/driver/scaleway.go +++ b/driver/scaleway.go @@ -40,9 +40,9 @@ type Driver struct { name string image string ip string + volumes string stopping bool created bool - // size string // userDataFile string // ipv6 bool } @@ -88,6 +88,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) (err error) { d.name = flags.String("scaleway-name") d.image = flags.String("scaleway-image") d.ip = flags.String("scaleway-ip") + d.volumes = flags.String("scaleway-volumes") return } @@ -134,6 +135,12 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag { Usage: "Specifies the IP address", Value: "", }, + mcnflag.StringFlag{ + EnvVar: "SCALEWAY_VOLUMES", + Name: "scaleway-volumes", + Usage: "Attach additional volume (e.g., 50G)", + Value: "", + }, mcnflag.BoolFlag{ EnvVar: "SCALEWAY_DEBUG", Name: "scaleway-debug", @@ -213,11 +220,12 @@ func (d *Driver) Create() (err error) { d.IPID = ip.IP.ID } d.ServerID, err = api.CreateServer(cl, &api.ConfigCreateServer{ - ImageName: d.image, - CommercialType: d.CommercialType, - Name: d.name, - Bootscript: defaultBootscript, - IP: d.IPID, + ImageName: d.image, + CommercialType: d.CommercialType, + Name: d.name, + Bootscript: defaultBootscript, + AdditionalVolumes: d.volumes, + IP: d.IPID, Env: strings.Join([]string{"AUTHORIZED_KEY", strings.Replace(string(publicKey[:len(publicKey)-1]), " ", "_", -1)}, "="), })