HTTP store doesn't allow deletion of image location
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
New
|
Undecided
|
Unassigned |
Bug Description
In case of ``http`` store, if bad value is passed for ``os_hash_value`` in validation data to add-location api, task fails which is expected but it stores location of the image which is wrong, that needs to be popped out. The location doesn't get deleted because deletion of location is not
allowed for ``http`` store. Here image needs to be deleted as it is of no use.
Steps to reproduce:
1. Create Image
$ glance image-create --container-format bare --disk-format raw --name test-image-
2. Check hash value of the image
$ sha256sum cirros-
34987d0d5702f88
3. Add location to the image along with invalid os_hash_value in validation data
$ glance add-location --url http://
4. Show Image
$ glance image-show af411b43-
+------
| Property | Value |
+------
| checksum | None |
| container_format | bare |
| created_at | 2024-08-
| disk_format | raw |
| id | af411b43-
| min_disk | 0 |
| min_ram | 0 |
| name | test-image-
| os_hash_algo | None |
| os_hash_value | None |
| os_hidden | False |
| owner | a16d88ef1c8c4e5
| protected | False |
| size | None |
| status | queued |
| stores | web |
| tags | [] |
| updated_at | 2024-08-
| virtual_size | Not available |
| visibility | shared |
+------
Image is reverted back to 'queued' as expected but location didn't popped out, see Stores : 'web'
g-api logs
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: WARNING glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: 5 predecessors (most recent first):
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: Atom 'location_
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: |__Atom 'location_
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: |__Atom 'location_
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: |__Atom 'location_
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: |__Flow 'location_import': glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: ERROR glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: ERROR glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: ERROR glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: ERROR glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: ERROR glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: ERROR glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: ERROR glance.
Aug 12 14:34:47 pranali-dev-caracal <email address hidden>[3078524]: DEBUG glance.