Skip to content

Commit fb88522

Browse files
committed
add --scaleway-image option
1 parent 139ee38 commit fb88522

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

driver/scaleway.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type Driver struct {
3535
Token string
3636
commercialType string
3737
name string
38+
image string
3839
stopping bool
3940
// size string
4041
// userDataFile string
@@ -72,6 +73,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) (err error) {
7273
}
7374
d.commercialType = flags.String("scaleway-commercial-type")
7475
d.name = flags.String("scaleway-name")
76+
d.image = flags.String("scaleway-image")
7577
return
7678
}
7779

@@ -106,6 +108,12 @@ func (d *Driver) GetCreateFlags() []mcnflag.Flag {
106108
Usage: "Specifies the commercial type",
107109
Value: "VC1S",
108110
},
111+
mcnflag.StringFlag{
112+
EnvVar: "SCALEWAY_IMAGE",
113+
Name: "scaleway-image",
114+
Usage: "Specifies the image",
115+
Value: defaultImage,
116+
},
109117
// mcnflag.StringFlag{
110118
// EnvVar: "SCALEWAY_USERDATA",
111119
// Name: "scaleway-userdata",
@@ -145,7 +153,7 @@ func (d *Driver) Create() (err error) {
145153
d.IPAddress = ip.IP.Address
146154
d.IPID = ip.IP.ID
147155
d.ServerID, err = api.CreateServer(cl, &api.ConfigCreateServer{
148-
ImageName: defaultImage,
156+
ImageName: d.image,
149157
CommercialType: d.commercialType,
150158
Name: d.name,
151159
Bootscript: defaultBootscript,

0 commit comments

Comments
 (0)