Skip to content

Commit 8ab44ca

Browse files
author
Quentin Perez
committed
Add commercial-type in the driver name
1 parent cbe2090 commit 8ab44ca

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

driver/scaleway.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type Driver struct {
3535
Organization string
3636
IPID string
3737
Token string
38-
commercialType string
38+
CommercialType string
3939
name string
4040
image string
4141
stopping bool
@@ -46,7 +46,10 @@ type Driver struct {
4646

4747
// DriverName returns the name of the driver
4848
func (d *Driver) DriverName() string {
49-
return "scaleway"
49+
if d.CommercialType == "" {
50+
return "scaleway"
51+
}
52+
return fmt.Sprintf("scaleway (%v)", d.CommercialType)
5053
}
5154

5255
func (d *Driver) getClient() (cl *api.ScalewayAPI, err error) {
@@ -78,7 +81,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) (err error) {
7881
return fmt.Errorf("You must provide organization and token")
7982
}
8083
}
81-
d.commercialType = flags.String("scaleway-commercial-type")
84+
d.CommercialType = flags.String("scaleway-commercial-type")
8285
d.name = flags.String("scaleway-name")
8386
d.image = flags.String("scaleway-image")
8487
return
@@ -166,7 +169,7 @@ func (d *Driver) Create() (err error) {
166169
d.IPID = ip.IP.ID
167170
d.ServerID, err = api.CreateServer(cl, &api.ConfigCreateServer{
168171
ImageName: d.image,
169-
CommercialType: d.commercialType,
172+
CommercialType: d.CommercialType,
170173
Name: d.name,
171174
Bootscript: defaultBootscript,
172175
IP: ip.IP.ID,

0 commit comments

Comments
 (0)