Skip to content

Commit d08add6

Browse files
committed
fix authorized_users which was always sent as an empty list
1 parent 1473de7 commit d08add6

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

pkg/drivers/linode/linode.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,18 @@ func (d *Driver) Create() error {
391391

392392
// Create a linode
393393
createOpts := linodego.InstanceCreateOptions{
394-
Region: d.Region,
395-
Type: d.InstanceType,
396-
Label: d.InstanceLabel,
397-
RootPass: d.RootPassword,
398-
AuthorizedUsers: strings.Split(d.AuthorizedUsers, ","),
399-
AuthorizedKeys: []string{strings.TrimSpace(publicKey)},
400-
Image: d.InstanceImage,
401-
SwapSize: &d.SwapSize,
402-
PrivateIP: d.CreatePrivateIP,
394+
Region: d.Region,
395+
Type: d.InstanceType,
396+
Label: d.InstanceLabel,
397+
RootPass: d.RootPassword,
398+
AuthorizedKeys: []string{strings.TrimSpace(publicKey)},
399+
Image: d.InstanceImage,
400+
SwapSize: &d.SwapSize,
401+
PrivateIP: d.CreatePrivateIP,
402+
}
403+
404+
if len(d.AuthorizedUsers) > 0 {
405+
createOpts.AuthorizedUsers = strings.Split(d.AuthorizedUsers, ",")
403406
}
404407

405408
if d.Tags != "" {

0 commit comments

Comments
 (0)