Skip to content

Commit 51fd7ab

Browse files
committed
enabled ipv6 and made req options only in one file
1 parent 1a45737 commit 51fd7ab

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

cmd/create.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ func buildInstance(options *options.Options) (*govultr.InstanceCreateReq, error)
109109
// generate instance object
110110
instance := &govultr.InstanceCreateReq{
111111
Label: options.MachineID,
112-
Hostname: "awesome-go.com",
113112
Backups: "disabled",
114-
EnableIPv6: govultr.BoolToBoolPtr(false),
115-
OsID: 362,
116-
Plan: "vc2-1c-1gb",
117-
Region: "blr",
118-
UserData: userData,
119-
Tags: []string{"devpod"},
113+
EnableIPv6: govultr.BoolToBoolPtr(true),
114+
// OsID: 477, // debian
115+
ImageID: "docker",
116+
Plan: "vc2-1c-1gb",
117+
Region: "blr",
118+
UserData: userData,
119+
Tags: []string{"devpod"},
120120
}
121121

122122
return instance, nil

pkg/vultr/vultr.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,9 @@ func (v *Vultr) Init(ctx context.Context) error {
3232
return nil
3333
}
3434

35-
func (v *Vultr) Create(ctx context.Context, req *govultr.InstanceCreateReq, diskSize int) error {
35+
func (v *Vultr) Create(ctx context.Context, reqOpts *govultr.InstanceCreateReq, diskSize int) error {
3636
// create droplet
37-
instanceOptions := &govultr.InstanceCreateReq{
38-
Label: req.Label,
39-
Hostname: req.Hostname,
40-
UserData: req.UserData,
41-
Backups: "disabled",
42-
EnableIPv6: govultr.BoolToBoolPtr(false),
43-
OsID: 477,
44-
Plan: "vc2-1c-1gb",
45-
Region: "blr",
46-
}
47-
48-
instance, _, err := v.client.Instance.Create(ctx, instanceOptions)
37+
instance, _, err := v.client.Instance.Create(ctx, reqOpts)
4938
if err != nil {
5039
return err
5140
}

0 commit comments

Comments
 (0)