vultr/vultr-cli

[BUG] - Option plans list

luisfelipe3d opened this issue ยท 5 comments

Describe the bug
When using docker to run vultr-cli in the plans list option, the following error is returned:

error getting plan list : json: cannot unmarshal number 7.5 into Go struct field Plan.plans.monthly_cost of type int

To Reproduce
Steps to reproduce the behavior:

  1. Install docker
  2. docker run -e VULTR_API_KEY=<API_KEY> --rm -it vultr/vultr-cli plans list
  3. See error

Expected behavior
A list of plans

Desktop

  • OS: Debian GNU/Linux bookworm/sid
  • Linux alohomora 5.19.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.19.6-1 (2022-09-01) x86_64 GNU/Linux
  • Docker version 20.10.17+dfsg1, build 100c701
  • Docker image version v2.15.0

Thanks for the report. It looks like a recent plan addition isn't handled gracefully. I'll push up a fix for that soon

@luisfelipe3d this is actually a result of the docker hub images not being updated. The latest tag is lagging for some reason which I'll fix. In the meantime you can specify vultr/vultr-cli:v2.15.0 to get it to work.

@luisfelipe3d this is actually a result of the docker hub images not being updated. The latest tag is lagging for some reason which I'll fix. In the meantime you can specify vultr/vultr-cli:v2.15.0 to get it to work.

It's work, thanks!

For those not using docker, upgrading your vultr-cli binary to version 2.15.0 makes it work.
I was previously using v2.5.2 and also got the "cannot unmarshal" error.
Another workaround is to get the plans list using the Vultr API:
curl -s "https://api.vultr.com/v2/plans" -X GET -H "API-Key: XXX"

This issue shouldn't be around in the latest version so I'm closing it.