← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1152319] Re: operations on deleted images should return 410 Gone

 

** Changed in: glance
       Status: Incomplete => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1152319

Title:
  operations on deleted images should return 410 Gone

Status in OpenStack Image Registry and Delivery Service (Glance):
  Invalid

Bug description:
  Operations on deleted images should return 410 Gone (assuming the user
  has authority). This includes GET and DELETE.

  Currently, you can DELETE an image and then GET it and DELETE it. For
  GET it returns 200 OK and the image. For DELETE it returns 403
  Forbidden.

  You can recreate this with devstack.

   $ glance image-list
   +--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
   | ID                                   | Name                            | Disk Format | Container Format | Size     | Status |
   +--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
   | 5e6d8a81-b39d-46a4-86d2-a107aa40bcdb | cirros-0.3.1-x86_64-uec         | ami         | ami              | 25165824 | active |
   ...
   +--------------------------------------+---------------------------------+-------------+------------------+----------+--------+

   $ glance image-delete 5e6d8a81-b39d-46a4-86d2-a107aa40bcdb

   $ glance image-show 5e6d8a81-b39d-46a4-86d2-a107aa40bcdb
   +------------------+--------------------------------------+
   | Property         | Value                                |
   +------------------+--------------------------------------+
   ...
   | id               | 5e6d8a81-b39d-46a4-86d2-a107aa40bcdb |
   ...
   | status           | deleted                              |
   +------------------+--------------------------------------+

   $ glance image-delete 5e6d8a81-b39d-46a4-86d2-a107aa40bcdb
   Request returned failure status.
   403 Forbidden
   Forbidden to delete a deleted image.
       (HTTP 403): Unable to delete image 5e6d8a81-b39d-46a4-86d2-a107aa40bcdb

  The reason I think this behavior is incorrect is HTTP 1.1 RFC (http://tools.ietf.org/html/rfc2616#section-9.7 ) says:
   """
     ... the server SHOULD NOT indicate success unless, at the time the response is given,
     it intends to delete the resource or move it to an inaccessible location.
   """

  So, glance should be moving the resource to an inaccessible location,
  which it is not doing.

  The suggested change is to have GET, DELETE, and other operations on deleted images to return 410 Gone:
  http://tools.ietf.org/html/rfc2616#section-10.4.11

  glance-client needs to be updated, too?

  Note that with this change should also update nova image-list to
  expect 410 Gone and image-delete to expect 410 Gone.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1152319/+subscriptions