Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provision machine without an IP or with a dynamic IP #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions driver/scaleway.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ var scwAPI *api.ScalewayAPI
// Driver represents the docker driver interface
type Driver struct {
*drivers.BaseDriver
ServerID string
Organization string
IPID string
Token string
CommercialType string
Region string
name string
image string
bootscript string
ip string
volumes string
IPPersistant bool
stopping bool
created bool
ipv6 bool
ServerID string
Organization string
IPID string
Token string
CommercialType string
Region string
name string
image string
bootscript string
ip string
volumes string
IPPersistant bool
DynamicIPRequired bool
stopping bool
created bool
ipv6 bool
// userDataFile string
}

Expand Down Expand Up @@ -196,7 +197,13 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
}

func (d *Driver) resolveIP(cl *api.ScalewayAPI) (err error) {
if d.ip != "" {
if d.ip == "dynamic" {
d.DynamicIPRequired = true
d.IPID = ""
} else if d.ip == "none" {
d.DynamicIPRequired = false
d.IPID = ""
} else if d.ip != "" {
var ips *api.ScalewayGetIPS

d.IPPersistant = true
Expand Down Expand Up @@ -268,6 +275,7 @@ func (d *Driver) Create() (err error) {
CommercialType: d.CommercialType,
Name: d.name,
Bootscript: d.bootscript,
DynamicIPRequired: d.DynamicIPRequired,
AdditionalVolumes: d.volumes,
IP: d.IPID,
EnableIPV6: d.ipv6,
Expand Down