digitalocean / doctl

The official command line interface for the DigitalOcean API.
https://docs.digitalocean.com/reference/doctl/
Apache License 2.0
3.26k stars 397 forks source link

Public images listed by default #198

Closed hvelarde closed 7 years ago

hvelarde commented 7 years ago

Public images should only be listed when using the --public flag:

$ doctl compute image list 
ID          Name                                                 Type        Distribution    Slug                    Public    Min Disk
23176823    1325.2.0 (beta)                                      snapshot    CoreOS          coreos-beta             true      20
6372321     5.10 x64                                             snapshot    CentOS                                  true      20
6372425     5.10 x32                                             snapshot    CentOS                                  true      20
13764801    Elixir on 14.04                                      snapshot    Ubuntu                                  true      30
14238961    23 x64                                               snapshot    Fedora                                  true      20
14782899    6.7 x32                                              snapshot    CentOS          centos-6-5-x32          true      20
14782952    6.7 x64                                              snapshot    CentOS          centos-6-5-x64          true      20
16071652    cloudbench-ycsb-on-1404.030216-1                     snapshot    Ubuntu                                  true      60
16071743    cloudbench-hibench-on-1404.030216-1                  snapshot    Ubuntu                                  true      60
16082940    cloudbench-nullworkload-on-1404.030316-6             snapshot    Ubuntu                                  true      20
...
xmudrii commented 7 years ago

I thought that doctl compute image list should return all images, not depending on status, but looks like I'm wrong. As looking at the code, this could be a bug, as default is really false for public images.

I'll send PR containing a fix right now, looks like I found where it is, just to test it.

Edit: PR published.