Skip to content

Commit be80b59

Browse files
authored
Update govultr from v3.9.1 to v3.11.0 (#481)
* Update govultr from v3.9.1 to v3.11.0 * Fix CDN bool pointer type changes * Remove tag from bare metal printer * Fix database pointer type changes
1 parent c435684 commit be80b59

File tree

5 files changed

+28
-30
lines changed

5 files changed

+28
-30
lines changed

cmd/baremetal/printer.go

-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func (b *BareMetalsPrinter) Columns() [][]string {
2929
return [][]string{0: {
3030
"ID",
3131
"IP",
32-
"TAG",
3332
"MAC ADDRESS",
3433
"LABEL",
3534
"OS",
@@ -50,7 +49,6 @@ func (b *BareMetalsPrinter) Data() [][]string {
5049
data = append(data, []string{
5150
b.BareMetals[i].ID,
5251
b.BareMetals[i].MainIP,
53-
b.BareMetals[i].Tag, //nolint: staticcheck
5452
strconv.Itoa(b.BareMetals[i].MacAddress),
5553
b.BareMetals[i].Label,
5654
b.BareMetals[i].Os,
@@ -93,7 +91,6 @@ func (b *BareMetalPrinter) Columns() [][]string {
9391
return [][]string{0: {
9492
"ID",
9593
"IP",
96-
"TAG",
9794
"MAC ADDRESS",
9895
"LABEL",
9996
"OS",
@@ -112,7 +109,6 @@ func (b *BareMetalPrinter) Data() [][]string {
112109
return [][]string{0: {
113110
b.BareMetal.ID,
114111
b.BareMetal.MainIP,
115-
b.BareMetal.Tag, //nolint: staticcheck
116112
strconv.Itoa(b.BareMetal.MacAddress),
117113
b.BareMetal.Label,
118114
b.BareMetal.Os,

cmd/cdn/cdn.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ func NewCmdCDN(base *cli.Base) *cobra.Command { //nolint:funlen,gocyclo
133133
Label: label,
134134
OriginScheme: scheme,
135135
OriginDomain: domain,
136-
CORS: cors,
137-
GZIP: gzip,
138-
BlockAI: blai,
139-
BlockBadBots: blbb,
136+
CORS: govultr.BoolToBoolPtr(cors),
137+
GZIP: govultr.BoolToBoolPtr(gzip),
138+
BlockAI: govultr.BoolToBoolPtr(blai),
139+
BlockBadBots: govultr.BoolToBoolPtr(blbb),
140140
}
141141

142142
pullZone, err := o.pullCreate()
@@ -218,19 +218,19 @@ func NewCmdCDN(base *cli.Base) *cobra.Command { //nolint:funlen,gocyclo
218218
}
219219

220220
if cmd.Flags().Changed("cors") {
221-
o.ZoneReq.CORS = cors
221+
o.ZoneReq.CORS = govultr.BoolToBoolPtr(cors)
222222
}
223223

224224
if cmd.Flags().Changed("gzip") {
225-
o.ZoneReq.GZIP = gzip
225+
o.ZoneReq.GZIP = govultr.BoolToBoolPtr(gzip)
226226
}
227227

228228
if cmd.Flags().Changed("block-ai") {
229-
o.ZoneReq.BlockAI = blai
229+
o.ZoneReq.BlockAI = govultr.BoolToBoolPtr(blai)
230230
}
231231

232232
if cmd.Flags().Changed("block-bad-bots") {
233-
o.ZoneReq.BlockBadBots = blbb
233+
o.ZoneReq.BlockBadBots = govultr.BoolToBoolPtr(blbb)
234234
}
235235

236236
pullZone, err := o.pullUpdate()
@@ -386,10 +386,10 @@ func NewCmdCDN(base *cli.Base) *cobra.Command { //nolint:funlen,gocyclo
386386

387387
o.ZoneReq = &govultr.CDNZoneReq{
388388
Label: label,
389-
CORS: cors,
390-
GZIP: gzip,
391-
BlockAI: blai,
392-
BlockBadBots: blbb,
389+
CORS: govultr.BoolToBoolPtr(cors),
390+
GZIP: govultr.BoolToBoolPtr(gzip),
391+
BlockAI: govultr.BoolToBoolPtr(blai),
392+
BlockBadBots: govultr.BoolToBoolPtr(blbb),
393393
}
394394

395395
pushZone, err := o.pushCreate()
@@ -464,19 +464,19 @@ func NewCmdCDN(base *cli.Base) *cobra.Command { //nolint:funlen,gocyclo
464464
}
465465

466466
if cmd.Flags().Changed("cors") {
467-
o.ZoneReq.CORS = cors
467+
o.ZoneReq.CORS = govultr.BoolToBoolPtr(cors)
468468
}
469469

470470
if cmd.Flags().Changed("gzip") {
471-
o.ZoneReq.GZIP = gzip
471+
o.ZoneReq.GZIP = govultr.BoolToBoolPtr(gzip)
472472
}
473473

474474
if cmd.Flags().Changed("block-ai") {
475-
o.ZoneReq.BlockAI = blai
475+
o.ZoneReq.BlockAI = govultr.BoolToBoolPtr(blai)
476476
}
477477

478478
if cmd.Flags().Changed("block-bad-bots") {
479-
o.ZoneReq.BlockBadBots = blbb
479+
o.ZoneReq.BlockBadBots = govultr.BoolToBoolPtr(blbb)
480480
}
481481

482482
if cmd.Flags().Changed("regions") {

cmd/database/printer.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (d *DBsPrinter) Data() [][]string { //nolint:funlen,gocyclo
4545
[]string{"PLAN DISK", strconv.Itoa(d.DBs[i].PlanDisk)},
4646
[]string{"PLAN RAM", strconv.Itoa(d.DBs[i].PlanRAM)},
4747
[]string{"PLAN VCPUS", strconv.Itoa(d.DBs[i].PlanVCPUs)},
48-
[]string{"PLAN REPLICAS", strconv.Itoa(d.DBs[i].PlanReplicas)},
48+
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DBs[i].PlanReplicas)},
4949
[]string{"REGION", d.DBs[i].Region},
5050
[]string{"DATABASE ENGINE", d.DBs[i].DatabaseEngine},
5151
[]string{"DATABASE ENGINE VERSION", d.DBs[i].DatabaseEngineVersion},
@@ -145,7 +145,7 @@ func (d *DBsPrinter) Data() [][]string { //nolint:funlen,gocyclo
145145
[]string{"PLAN DISK", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanDisk)},
146146
[]string{"PLAN RAM", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanRAM)},
147147
[]string{"PLAN VCPUS", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanVCPUs)},
148-
[]string{"PLAN REPLICAS", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanReplicas)},
148+
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DBs[i].ReadReplicas[j].PlanReplicas)},
149149
[]string{"REGION", d.DBs[i].ReadReplicas[j].Region},
150150
[]string{"DATABASE ENGINE", d.DBs[i].ReadReplicas[j].DatabaseEngine},
151151
[]string{"DATABASE ENGINE VERSION", d.DBs[i].ReadReplicas[j].DatabaseEngineVersion},
@@ -278,7 +278,7 @@ func (d *DBPrinter) Data() [][]string { //nolint:funlen,gocyclo
278278
[]string{"PLAN DISK", strconv.Itoa(d.DB.PlanDisk)},
279279
[]string{"PLAN RAM", strconv.Itoa(d.DB.PlanRAM)},
280280
[]string{"PLAN VCPUS", strconv.Itoa(d.DB.PlanVCPUs)},
281-
[]string{"PLAN REPLICAS", strconv.Itoa(d.DB.PlanReplicas)},
281+
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DB.PlanReplicas)},
282282
[]string{"REGION", d.DB.Region},
283283
[]string{"DATABASE ENGINE", d.DB.DatabaseEngine},
284284
[]string{"DATABASE ENGINE VERSION", d.DB.DatabaseEngineVersion},
@@ -378,7 +378,7 @@ func (d *DBPrinter) Data() [][]string { //nolint:funlen,gocyclo
378378
[]string{"PLAN DISK", strconv.Itoa(d.DB.ReadReplicas[i].PlanDisk)},
379379
[]string{"PLAN RAM", strconv.Itoa(d.DB.ReadReplicas[i].PlanRAM)},
380380
[]string{"PLAN VCPUS", strconv.Itoa(d.DB.ReadReplicas[i].PlanVCPUs)},
381-
[]string{"PLAN REPLICAS", strconv.Itoa(d.DB.ReadReplicas[i].PlanReplicas)},
381+
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DB.ReadReplicas[i].PlanReplicas)},
382382
[]string{"REGION", d.DB.ReadReplicas[i].Region},
383383
[]string{"DATABASE ENGINE", d.DB.ReadReplicas[i].DatabaseEngine},
384384
[]string{"DATABASE ENGINE VERSION", d.DB.ReadReplicas[i].DatabaseEngineVersion},
@@ -1264,8 +1264,8 @@ func (a *AdvancedOptionsPrinter) Data() [][]string {
12641264

12651265
if a.Available[i].Type == "int" || a.Available[i].Type == "float" {
12661266
data = append(data,
1267-
[]string{"MIN VALUE", strconv.Itoa(*a.Available[i].MinValue)},
1268-
[]string{"MAX VALUE", strconv.Itoa(*a.Available[i].MaxValue)},
1267+
[]string{"MIN VALUE", strconv.FormatFloat(float64(*a.Available[i].MinValue), 'f', utils.FloatPrecision, 32)},
1268+
[]string{"MAX VALUE", strconv.FormatFloat(float64(*a.Available[i].MaxValue), 'f', utils.FloatPrecision, 32)},
12691269
)
12701270
}
12711271

go.mod

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
module github.com/vultr/vultr-cli/v3
22

3-
go 1.21
3+
go 1.23
4+
5+
toolchain go1.23.1
46

57
require (
68
github.com/spf13/cobra v1.8.1
79
github.com/spf13/viper v1.19.0
8-
github.com/vultr/govultr/v3 v3.9.1
10+
github.com/vultr/govultr/v3 v3.11.0
911
golang.org/x/oauth2 v0.23.0
1012
gopkg.in/yaml.v3 v3.0.1
1113
)

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
7575
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
7676
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
7777
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
78-
github.com/vultr/govultr/v3 v3.9.1 h1:uxSIb8Miel7tqTs3ee+z3t+JelZikwqBBsZzCOPBy/8=
79-
github.com/vultr/govultr/v3 v3.9.1/go.mod h1:Rd8ebpXm7jxH3MDmhnEs+zrlYW212ouhx+HeUMfHm2o=
78+
github.com/vultr/govultr/v3 v3.11.0 h1:YlAal70AaJ0k848RqcmjAzFcmLS9n8VtPgU68UxvVm8=
79+
github.com/vultr/govultr/v3 v3.11.0/go.mod h1:q34Wd76upKmf+vxFMgaNMH3A8BbsPBmSYZUGC8oZa5w=
8080
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
8181
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
8282
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=

0 commit comments

Comments
 (0)