glance_store/glance_store
Rajat Dhasmana c2b7b78d4f Use normal credentials for legacy image update
When updating legacy images, currenly we use the user's
context and elevate priviledges. However, we do not
require admin priviledges for the cinder API calls.

This patch removes the special case where we elevate
priviledges as it wasn't doing anything rather avoiding
us to use right credentials and failing to fetch volume
in the right location because of wrong credentials.

The correct credentials are either the service ones
set in glance-api.conf file or the user context
credentials, using which the Image-Volume was created.

NOTE: When using cinder as glance backend and we want
to perform optimized volume upload to image, one thing
we should make sure is either using the context or the
cinder credentials set in glance-api.conf file, it should
match the following details on the cinder side (if we are
using internal context to create clone of image-volumes):

cinder_store_user_name = context.user_id/cinder_internal_tenant_user_id
cinder_store_project_name = context.project_id/cinder_internal_tenant_project_id

The cinder_internal_tenant_user_id and
cinder_internal_tenant_project_id are set in the
[DEFAULT] section of cinder.conf.

This issue was first discovered when testing the new
location APIs[1] where tempest creates a volume with
cinder's internal context and glance uses wrong (user context)
credentials to access it and failing with 404 not found.

[1] https://review.opendev.org/c/openstack/cinder/+/909847

Closes-Bug: #2056179
Change-Id: I4f27a9800f239da8dbf29f4c028678df1f867664
2024-04-08 23:53:24 +05:30
..
_drivers Use normal credentials for legacy image update 2024-04-08 23:53:24 +05:30
common Cinder: Add support to extend attached volumes 2023-01-18 15:46:49 +05:30
locale Imported Translations from Zanata 2023-07-08 02:08:39 +00:00
tests Use normal credentials for legacy image update 2024-04-08 23:53:24 +05:30
__init__.py Enable multi store support for glance 2018-07-15 15:10:27 +00:00
backend.py Remove Python 2 support 2022-05-25 04:42:06 +02:00
capabilities.py Removed 'store_capabilities_update_min_interval' config option 2019-05-29 06:23:03 +00:00
driver.py Add per-store weight config element 2023-06-15 06:57:53 -07:00
exceptions.py Remove Python 2 support 2022-05-25 04:42:06 +02:00
i18n.py Update oslo libraries 2015-03-19 11:43:42 -05:00
location.py Remove Python 2 support 2022-05-25 04:42:06 +02:00
multi_backend.py Remove Python 2 support 2022-05-25 04:42:06 +02:00