gophercloud / gophercloud

Gophercloud: an OpenStack SDK for Go
https://pkg.go.dev/github.com/gophercloud/gophercloud/v2
Other
896 stars 531 forks source link

missing details when converting app code from gophercloud/openstack/compute/v2/images ListDetails() to gophercloud/openstack/image/v2/images List() #3239

Open tannevaled opened 3 hours ago

tannevaled commented 3 hours ago

Hi.

Before the 2.2.0 release, when using the ListDetails function i could retrieve the image Tags, DiskFormat, Metadata... Presently (upgrading to the v2.2.0) when using the List function, Tags, DiskFormat, Metadata... are nil/empty. Is this a bug or is there some planned parameters to explicitly ask for those data?

image: (*images.Image)(0x14000400840)({
     ID: (string) (len=36) "9169a33f-e75b-4dda-b577-800b83eb31a9",
     Name: (string) (len=5) "noble",
     Status: (images.ImageStatus) "",
     Tags: ([]string) <nil>,
     ContainerFormat: (string) "",
     DiskFormat: (string) "",
     MinDiskGigabytes: (int) 0,
     MinRAMMegabytes: (int) 0,
     Owner: (string) "",
     Protected: (bool) false,
     Visibility: (images.ImageVisibility) "",
     Hidden: (bool) false,
     Checksum: (string) "",
     SizeBytes: (int64) 0,
     Metadata: (map[string]string) <nil>,
     Properties: (map[string]interface {}) (len=1) {
      (string) (len=5) "links": ([]interface {}) (len=3 cap=4) {
       (map[string]interface {}) (len=2) {
        (string) (len=4) "href": (string) (len=79) "https://nova.domain.tld:8774/v2.1/images/9169a33f-e75b-4dda-b577-800b83eb31a9",
        (string) (len=3) "rel": (string) (len=4) "self"
       },
       (map[string]interface {}) (len=2) {
        (string) (len=4) "href": (string) (len=74) "https://nova.domain.tld:8774/images/9169a33f-e75b-4dda-b577-800b83eb31a9",
        (string) (len=3) "rel": (string) (len=8) "bookmark"
       },
       (map[string]interface {}) (len=3) {
        (string) (len=4) "href": (string) (len=83) "https://glance-admin.domain.tldr:9292//images/9169a33f-e75b-4dda-b577-800b83eb31a9",
        (string) (len=3) "rel": (string) (len=9) "alternate",
        (string) (len=4) "type": (string) (len=31) "application/vnd.openstack.image"
       }
      }
     },
     CreatedAt: (time.Time) 0001-01-01 00:00:00 +0000 UTC,
     UpdatedAt: (time.Time) 0001-01-01 00:00:00 +0000 UTC,
     File: (string) "",
     Schema: (string) "",
     VirtualSize: (int64) 0,
     OpenStackImageImportMethods: ([]string) <nil>,
     OpenStackImageStoreIDs: ([]string) <nil>
    })
...

In the same time the result is ok with the openstack cli

pkgx +opendev.org/openstack/python-openstackclient@latest openstack image list --verbose --name noble --long -f json

 ✓  ~/.pkgx/opendev.org/openstack/python-openstackclient/v7.2.1

START with options: image list --verbose --name noble --long -f json
command: image list -> openstackclient.image.v2.image.ListImage (auth=True)
Using auth plugin: password
[
  {
    "ID": "ed0c9070-1782-4862-975a-05dd01eedcb6",
    "Name": "noble",
    "Disk Format": "qcow2",
    "Container Format": "bare",
    "Size": 587241984,
    "Checksum": "a1c8a01953578ad432cbef03db2f3161",
    "Status": "active",
    "Visibility": "private",
    "Protected": false,
    "Project": "d12038acb795476f9de95635ca09a81f",
    "Tags": [
      "ARCHITECTURE=amd64",
      "DEPLOYMENT_ID=f55d197b",
      "DEPLOYMENT_UUID=f55d197b-5960-6443-6250-3fb77deed3d1",
      "FLAVOR=server",
      "DISTRIBUTION=ubuntu",
      "VERSION=24.04"
    ]
  },
  {
    "ID": "c3a447a8-ef77-4da0-a5b8-e46121922475",
    "Name": "noble",
    "Disk Format": "qcow2",
    "Container Format": "bare",
    "Size": 604962816,
    "Checksum": "260bfd46d0851adfe40acaeb09084b9c",
    "Status": "active",
    "Visibility": "private",
    "Protected": false,
    "Project": "d12038acb795476f9de95635ca09a81f",
    "Tags": [
      "DEPLOYMENT_ID=f55d197b",
      "DEPLOYMENT_UUID=f55d197b-5960-6443-6250-3fb77deed3d1",
      "FLAVOR=server",
      "DISTRIBUTION=ubuntu",
      "ARCHITECTURE=riscv64",
      "VERSION=24.04"
    ]
  },
  {
    "ID": "9169a33f-e75b-4dda-b577-800b83eb31a9",
    "Name": "noble",
    "Disk Format": "qcow2",
    "Container Format": "bare",
    "Size": 579387392,
    "Checksum": "9b4b8ee2be8ad36a5cedd2f2c4356e6f",
    "Status": "active",
    "Visibility": "private",
    "Protected": false,
    "Project": "d12038acb795476f9de95635ca09a81f",
    "Tags": [
      "ARCHITECTURE=arm64",
      "DEPLOYMENT_ID=f55d197b",
      "DEPLOYMENT_UUID=f55d197b-5960-6443-6250-3fb77deed3d1",
      "FLAVOR=server",
      "DISTRIBUTION=ubuntu",
      "VERSION=24.04"
    ]
  }
]

Thanks in advance.

github-actions[bot] commented 3 hours ago

Thank you for reporting your first issue! Be sure that we will be looking at it, but keep in mind this sometimes takes a while. Please let the maintainers know if your issue has not got enough attention after a few days. If any doubt, please consult our issue tutorial.