ionos-cloud / ionosctl

The IONOS Cloud CLI (ionosctl) gives the ability to manage IONOS Cloud infrastructure directly from Command Line.
Apache License 2.0
28 stars 6 forks source link

Output of image list is inconsistent with image get #118

Closed hikhvar closed 2 years ago

hikhvar commented 2 years ago

Description

The output of ionosctl image list is inconsistent with the output of ionosctl image get. I wanted to find images with cloud init enabled. All images returned by ionosctl image list return NONE for cloud init. However, the image with the id ac995711-e319-11eb-a927-824af8c35c96 reports cloud init V1 when issuing a ionosctl image get.

Example:

# List all images, select the image by ID via jq
 $GOBIN/ionosctl image list -o json | jq '.Resources[] | select( .id =="ac995711-e319-11eb-a927-824af8c35c96") | .properties.cloudInit '
"NONE"

# The tabular view has the same `NONE` value for `CloudInit`
$GOBIN/ionosctl image list | grep -E "(ImageId|ac995711-e319-11eb-a927-824af8c35c96)"                                                           
ImageId                                Name                                        ImageAliases                           Location   LicenceType   ImageType   CloudInit   CreatedDate
ac995711-e319-11eb-a927-824af8c35c96   Debian-10-cloud-init.qcow2                  []                                     es/vit     LINUX         HDD         NONE        2021-07-12 14:01:37 +0000 UTC

# If we get the image, we see however the cloudInit property set to `V1`
$GOBIN/ionosctl image get --image-id ac995711-e319-11eb-a927-824af8c35c96 -o json | jq '.Resources[].properties.cloudInit'         
"V1"

$GOBIN/ionosctl image get --image-id ac995711-e319-11eb-a927-824af8c35c96                                                                              
ImageId                                Name                         ImageAliases   Location   LicenceType   ImageType   CloudInit   CreatedDate
ac995711-e319-11eb-a927-824af8c35c96   Debian-10-cloud-init.qcow2   []             es/vit     LINUX         HDD         V1          2021-07-12 14:01:37 +0000 UTC

Expected behavior

ionosctl image list and ionosctl image get report consistent data.

Environment

Go Version:

go version
go version go1.17.1 linux/amd64

Ionosctl version:

# Can reproduce with both

$GOBIN/ionosctl version
IONOS Cloud CLI version: DEV
SDK GO version: 6.0.0-beta.6

ionosctl version 
IONOS Cloud CLI version: 5.0.8
SDK GO version: 5.1.5

OS:

cat /etc/issue
Manjaro Linux \r  (\n) (\l)

Shell:

Configuration Files

How to Reproduce

Error and Debug Output

Additional Notes

References

oana-ungureanu-ionos commented 2 years ago

Hi @hikhvar, thank you for opening this issue. We wanted to let you know that we are currently investigating this behavior and we'll get back to you with updates on the issue.

ana-moga commented 2 years ago

Hello,

I am not able to replicate this bug locally. See attachments:

Can you please (re)confirm that you are still facing this issue locally? I am asking this since there might have been some temporary issues with the API response on get requests, independently of the cli, which takes the response and prints it out.

Thank you, Ana

hikhvar commented 2 years ago

Still can produce it locally. I tried to call the API directly via curl. I get the same result there:

curl -s --request GET --user "$IONOS_USERNAME:$IONOS_PASSWORD" --url "https://api.ionos.com/cloudapi/v6/images?pretty=true&depth=3" | jq -r '.items[].properties.cloudInit' | sort | uniq -c
    305 NONE

Every image has the property cloudInit set to NONE. I heard the cloud init feature is a beta feature? I can start and provision VMs with cloud init. Maybe there is a bug with the API?

ana-moga commented 2 years ago

Yeah. It is different. It seems to be a bug with the API.

curl -s --request GET --user "$IONOS_USERNAME:$IONOS_PASSWORD" --url "https://api.ionos.com/cloudapi/v6/images?pretty=true&depth=3" | jq -r '.items[].properties.cloudInit' | sort | uniq -c
    263 NONE
     42 V1

This should go/be reported to Provisioning Platform team or VDC team. CC: @omungureanu

ana-moga commented 2 years ago

Hello,

Just a note: with the latest version of ionosctl v6 and v5, you can filter the result for the image list command. Example:

ionosctl image list --filters location=es/vit,cloudInit=V1,name=Debian-10-cloud-init.qcow2
ana-moga commented 2 years ago

Hello,

This was fixed from the VDC team. Can you please recheck and confirm if this is still an issue?

Thank you, Ana

hikhvar commented 2 years ago

This is fixed. Will close this. Thank you for resolving this!