Skip to content

Commit

Permalink
Update govultr from v3.9.1 to v3.11.0 (#481)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
optik-aper authored Oct 23, 2024
1 parent c435684 commit be80b59
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 30 deletions.
4 changes: 0 additions & 4 deletions cmd/baremetal/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func (b *BareMetalsPrinter) Columns() [][]string {
return [][]string{0: {
"ID",
"IP",
"TAG",
"MAC ADDRESS",
"LABEL",
"OS",
Expand All @@ -50,7 +49,6 @@ func (b *BareMetalsPrinter) Data() [][]string {
data = append(data, []string{
b.BareMetals[i].ID,
b.BareMetals[i].MainIP,
b.BareMetals[i].Tag, //nolint: staticcheck
strconv.Itoa(b.BareMetals[i].MacAddress),
b.BareMetals[i].Label,
b.BareMetals[i].Os,
Expand Down Expand Up @@ -93,7 +91,6 @@ func (b *BareMetalPrinter) Columns() [][]string {
return [][]string{0: {
"ID",
"IP",
"TAG",
"MAC ADDRESS",
"LABEL",
"OS",
Expand All @@ -112,7 +109,6 @@ func (b *BareMetalPrinter) Data() [][]string {
return [][]string{0: {
b.BareMetal.ID,
b.BareMetal.MainIP,
b.BareMetal.Tag, //nolint: staticcheck
strconv.Itoa(b.BareMetal.MacAddress),
b.BareMetal.Label,
b.BareMetal.Os,
Expand Down
32 changes: 16 additions & 16 deletions cmd/cdn/cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ func NewCmdCDN(base *cli.Base) *cobra.Command { //nolint:funlen,gocyclo
Label: label,
OriginScheme: scheme,
OriginDomain: domain,
CORS: cors,
GZIP: gzip,
BlockAI: blai,
BlockBadBots: blbb,
CORS: govultr.BoolToBoolPtr(cors),
GZIP: govultr.BoolToBoolPtr(gzip),
BlockAI: govultr.BoolToBoolPtr(blai),
BlockBadBots: govultr.BoolToBoolPtr(blbb),
}

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

if cmd.Flags().Changed("cors") {
o.ZoneReq.CORS = cors
o.ZoneReq.CORS = govultr.BoolToBoolPtr(cors)
}

if cmd.Flags().Changed("gzip") {
o.ZoneReq.GZIP = gzip
o.ZoneReq.GZIP = govultr.BoolToBoolPtr(gzip)
}

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

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

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

o.ZoneReq = &govultr.CDNZoneReq{
Label: label,
CORS: cors,
GZIP: gzip,
BlockAI: blai,
BlockBadBots: blbb,
CORS: govultr.BoolToBoolPtr(cors),
GZIP: govultr.BoolToBoolPtr(gzip),
BlockAI: govultr.BoolToBoolPtr(blai),
BlockBadBots: govultr.BoolToBoolPtr(blbb),
}

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

if cmd.Flags().Changed("cors") {
o.ZoneReq.CORS = cors
o.ZoneReq.CORS = govultr.BoolToBoolPtr(cors)
}

if cmd.Flags().Changed("gzip") {
o.ZoneReq.GZIP = gzip
o.ZoneReq.GZIP = govultr.BoolToBoolPtr(gzip)
}

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

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

if cmd.Flags().Changed("regions") {
Expand Down
12 changes: 6 additions & 6 deletions cmd/database/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (d *DBsPrinter) Data() [][]string { //nolint:funlen,gocyclo
[]string{"PLAN DISK", strconv.Itoa(d.DBs[i].PlanDisk)},
[]string{"PLAN RAM", strconv.Itoa(d.DBs[i].PlanRAM)},
[]string{"PLAN VCPUS", strconv.Itoa(d.DBs[i].PlanVCPUs)},
[]string{"PLAN REPLICAS", strconv.Itoa(d.DBs[i].PlanReplicas)},
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DBs[i].PlanReplicas)},
[]string{"REGION", d.DBs[i].Region},
[]string{"DATABASE ENGINE", d.DBs[i].DatabaseEngine},
[]string{"DATABASE ENGINE VERSION", d.DBs[i].DatabaseEngineVersion},
Expand Down Expand Up @@ -145,7 +145,7 @@ func (d *DBsPrinter) Data() [][]string { //nolint:funlen,gocyclo
[]string{"PLAN DISK", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanDisk)},
[]string{"PLAN RAM", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanRAM)},
[]string{"PLAN VCPUS", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanVCPUs)},
[]string{"PLAN REPLICAS", strconv.Itoa(d.DBs[i].ReadReplicas[j].PlanReplicas)},
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DBs[i].ReadReplicas[j].PlanReplicas)},
[]string{"REGION", d.DBs[i].ReadReplicas[j].Region},
[]string{"DATABASE ENGINE", d.DBs[i].ReadReplicas[j].DatabaseEngine},
[]string{"DATABASE ENGINE VERSION", d.DBs[i].ReadReplicas[j].DatabaseEngineVersion},
Expand Down Expand Up @@ -278,7 +278,7 @@ func (d *DBPrinter) Data() [][]string { //nolint:funlen,gocyclo
[]string{"PLAN DISK", strconv.Itoa(d.DB.PlanDisk)},
[]string{"PLAN RAM", strconv.Itoa(d.DB.PlanRAM)},
[]string{"PLAN VCPUS", strconv.Itoa(d.DB.PlanVCPUs)},
[]string{"PLAN REPLICAS", strconv.Itoa(d.DB.PlanReplicas)},
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DB.PlanReplicas)},
[]string{"REGION", d.DB.Region},
[]string{"DATABASE ENGINE", d.DB.DatabaseEngine},
[]string{"DATABASE ENGINE VERSION", d.DB.DatabaseEngineVersion},
Expand Down Expand Up @@ -378,7 +378,7 @@ func (d *DBPrinter) Data() [][]string { //nolint:funlen,gocyclo
[]string{"PLAN DISK", strconv.Itoa(d.DB.ReadReplicas[i].PlanDisk)},
[]string{"PLAN RAM", strconv.Itoa(d.DB.ReadReplicas[i].PlanRAM)},
[]string{"PLAN VCPUS", strconv.Itoa(d.DB.ReadReplicas[i].PlanVCPUs)},
[]string{"PLAN REPLICAS", strconv.Itoa(d.DB.ReadReplicas[i].PlanReplicas)},
[]string{"PLAN REPLICAS", strconv.Itoa(*d.DB.ReadReplicas[i].PlanReplicas)},
[]string{"REGION", d.DB.ReadReplicas[i].Region},
[]string{"DATABASE ENGINE", d.DB.ReadReplicas[i].DatabaseEngine},
[]string{"DATABASE ENGINE VERSION", d.DB.ReadReplicas[i].DatabaseEngineVersion},
Expand Down Expand Up @@ -1264,8 +1264,8 @@ func (a *AdvancedOptionsPrinter) Data() [][]string {

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

Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module github.com/vultr/vultr-cli/v3

go 1.21
go 1.23

toolchain go1.23.1

require (
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/vultr/govultr/v3 v3.9.1
github.com/vultr/govultr/v3 v3.11.0
golang.org/x/oauth2 v0.23.0
gopkg.in/yaml.v3 v3.0.1
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/vultr/govultr/v3 v3.9.1 h1:uxSIb8Miel7tqTs3ee+z3t+JelZikwqBBsZzCOPBy/8=
github.com/vultr/govultr/v3 v3.9.1/go.mod h1:Rd8ebpXm7jxH3MDmhnEs+zrlYW212ouhx+HeUMfHm2o=
github.com/vultr/govultr/v3 v3.11.0 h1:YlAal70AaJ0k848RqcmjAzFcmLS9n8VtPgU68UxvVm8=
github.com/vultr/govultr/v3 v3.11.0/go.mod h1:q34Wd76upKmf+vxFMgaNMH3A8BbsPBmSYZUGC8oZa5w=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
Expand Down

0 comments on commit be80b59

Please sign in to comment.