Skip to content

Commit 16f682a

Browse files
committed
Merge pull request #35 from QuentinPerez/patch-3
Add commercial-type in the driver name
2 parents 0fc9385 + 8ab44ca commit 16f682a

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
@@ -47,7 +47,10 @@ type Driver struct {
4747

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

5356
func (d *Driver) getClient() (cl *api.ScalewayAPI, err error) {
@@ -79,7 +82,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) (err error) {
7982
return fmt.Errorf("You must provide organization and token")
8083
}
8184
}
82-
d.commercialType = flags.String("scaleway-commercial-type")
85+
d.CommercialType = flags.String("scaleway-commercial-type")
8386
d.name = flags.String("scaleway-name")
8487
d.image = flags.String("scaleway-image")
8588
return
@@ -167,7 +170,7 @@ func (d *Driver) Create() (err error) {
167170
d.IPID = ip.IP.ID
168171
d.ServerID, err = api.CreateServer(cl, &api.ConfigCreateServer{
169172
ImageName: d.image,
170-
CommercialType: d.commercialType,
173+
CommercialType: d.CommercialType,
171174
Name: d.name,
172175
Bootscript: defaultBootscript,
173176
IP: ip.IP.ID,

0 commit comments

Comments
 (0)