Commit Graph

1257 Commits

Author SHA1 Message Date
Cyril Roelandt a7c878eed9 Remove allow_additional_image_properties
This option has been deprecated since Ussuri.

Change-Id: Ib3016f7b4b841543b02710c496e8387e63ed36c3
2024-04-23 18:32:58 +02:00
Abhishek Kekane fd222f3128 Sort locations based on store weight
Related to blueprint store-weight

Change-Id: I2383a476cb7e79c7efecdf33203cff0b50ef3bbb
2023-08-01 14:16:08 +00:00
Takashi Kajinami 7ab9001750 Refactor pipeline definition
This introduces a new pipeline_factory so that we can use a single
entry to define pipeline for each deployment flavor.

Change-Id: Ia9b251f0e48f69baa0c5c988b91b216a627ed028
2023-05-10 12:34:56 +09:00
David Hill 1da3e48fa8 Enclose all APIv2 versions in single quotes
When version detection broke for v2.10, only 2.10 was changed to
be enclosed between single quotes but all of them should be the same
format, a string.  In this case, some of the versions are floats
and converted to strings in build_version_object which is not pretty.

Change-Id: I3f67671c4426ff7f0080ccc5bcfb69e7f386c9fc
Closes-bug: #2008116
2023-02-22 12:46:08 -05:00
Pranali Deore b20cc91e6f Remove deprecated ``enforce_secure_rbac`` option
As per the revised SRBAC community goals, glance service is now
switching to new defaults by default hence removing the deprecated
``enforce_secure_rbac`` option which is no longer needed.

The ``enforce_secure_rbac`` option was introduced EXPERIMENTAL in
Wallaby release for operators to opt into enforcing authorization
based on common RBAC personas.

Related blueprint secure-rbac

Change-Id: I273527c85d30c1c09c086c73c892aaa6d127df6b
2023-02-16 11:12:59 +00:00
Pranali Deore 8c04d19e88 Enabled new defaults and scope checks by default
Enabling the enforce scope and new defaults by default in glance

Related blueprint secure-rbac

Change-Id: I0808dc0b1b34b527e38aa137c1dd25e1fc06409f
2023-02-16 11:11:31 +00:00
Zuul 623fd75d39 Merge "Fix a deprecation warning about threading.Thread" 2022-08-26 09:39:06 +00:00
Zuul 5c675bddcf Merge "Extending stores-detail API" 2022-08-24 12:05:46 +00:00
Pierre-Samuel Le Stang 480ea3825f Implement glance-download internal plugin
Add a new import method called glance-download
that implements a glance to glance download in
a multi-region cloud with a federated Keystone.

This method will copy the image data and
selected metadata to the target glance, checking
that the downloaded size match the "size" image
attribute in the source glance.

Implements: blueprint glance-download-import
Co-Authored-By: Victor Coutellier <victor.coutellier@gmail.com>
Change-Id: Ic51c5fd87caf04d38aeaf758ad2d0e2f28098e4d
2022-08-23 08:26:52 -07:00
Mridula Joshi b0d727d028 Extending stores-detail API
This patch extends the functionality of the API
``GET /v2/info/stores/detail`` to expose store details
of other stores. Currently the ``stores-detail`` API
exposes store details of RBD backend.

Implements: blueprint expanding-stores-detail
Change-Id: I0c7bbc315b56dc0e40397b4ed8a68d1668203c44
2022-08-23 14:42:53 +00:00
Takashi Natsume 1b08481491 Fix a deprecation warning about threading.Thread
Fix the following deprecation warning.

* DeprecationWarning: setDaemon() is deprecated,
  set the daemon attribute instead

Change-Id: I7af41eddf597e1ac78e8835a5af2e029d65a302a
Closes-Bug: 1987191
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-08-21 21:16:07 +09:00
Abhishek Kekane c1a2b9e221 Immediate caching of an image
Till now glance was dependent on periodic job to get image
cached locally and also has dependency on ``cachemanage``
middleware for the same.

This patch removes the periodic job and dependency of
``cachemanage`` middleware and initiates immediate caching
of an image via ``PUT /cache/image_id`` API call.

Co-Author: Dan Smith <dms@danplanet.com>

Implements: blueprint instant-caching
Change-Id: I9ab3f1b7595e22dbb03af95168314352a44eb930
2022-07-19 05:14:38 +00:00
Cyril Roelandt 0cbdfdde40 Fix URLs in the form docs.openstack.org/developer/$project
These URLs are now in the form docs.openstack.org/$project/latest. Make
sure to use always use https for these URLs.

Change-Id: I4a75bb6097399efca373d2f9a0e8697eb92312a7
2022-07-05 19:23:33 +02:00
Abhishek Kekane a71f7ba44e [APIImpact] Correct API response code for DELETE cache APIs
DELETE /v2/cache/{image_id} and /v2/cache returns HTTP 200 response
code to user but as per proposal it should be HTTP 204. This change
returns HTTP 204 response to user.

Closes-Bug: #1980049
Change-Id: I9d1c25638584fe346e3937d0536413d548d46e8e
2022-06-28 17:31:12 +00:00
Pranali Deore 3790cfd4a1 Remove dead code of auth and policy layers
In Xena we have mangaed to move all policy checks to API layer,
now removing the dead code from policy and authorization layer

NOTE: Some of the code is still being used from policy layer,
hence keeping it there only at this moment.

Change-Id: Ibee749cde20687d8c243cf84ae80b4de67d8ef3d
2022-06-14 10:15:55 +00:00
Brian Rosmaita 11989a18f4 Bump Image API version to 2.16
This API version increment is due to change I6a875a38bef5, which
corrected the response code for the admin-only API call:
    PUT /v2/cache/{image_id}
The call now returns 202 upon success (it had been returning 200).

The intent of this version bump is to get the attention of operators
to take note of this change; from now on, the call always returns 202
upon success regardless of what API version you request.

Additionally, cleaned up some version tests that had gotten out of
date and were not thoroughly testing version negotiation.

Also, corrected the version negotiation code around the v2.13 API.
The versions response had been modified by change I6882fd2381e6 to
only include v2.13 when the 'enabled_backends' config option had a
value, but the versions negotiation code was not updated to reflect
that.

Change-Id: I0cf35ed7e21497826cd581e59aa58774f030b9f6
Related-bug: #1971521
2022-05-24 11:45:30 -04:00
Zuul bfcab95ff2 Merge "Delay string interpolations at logging calls" 2022-05-18 14:01:32 +00:00
Dan Smith 35e6c57bc9 Fix failing namespace list delete race
If a namespace is deleted by another client while we are doing a
namespace list operation, we will fail the list with NotFound if we
try to pull the resource_type_associations list. The latter re-queries
the DB for the namespace and will raise NotFound to us. This is
especially bad because the namespace being deleted need not even
belong to the caller of the list, as is the case in a tempest run.

This makes us catch the failure and continue the operation, reporting
no associations so that the client gets a consistent view and no
error.

Closes-Bug: #1973631
Change-Id: I09fc9164a08f42507d2aec44c5b382a72f232571
2022-05-16 12:29:55 -07:00
Cyril Roelandt 1962f47ed2 Delay string interpolations at logging calls
This was already fixed in 4889dc1814 but
we did not enforce this rule and reintroduced "bad" string
interpolations. This patch adds a hacking rule to prevent us from doing
this again in the future.

Change-Id: I96d9a157d3887286542859d67138ffdae5a589f1
2022-05-14 03:17:34 +02:00
Abhishek Kekane ecb040c177 [APIImpact] Correct API response code for PUT /v2/cache/{image_id}
PUT /v2/cache/{image_id} returns HTTP 200 response code to user but as per
proposal it should be HTTP 202. This change returns HTTP 202 response to
user.

Closes-Bug: #1971521
Change-Id: I6a875a38bef5beafe352ab3320f3fd199db89aa1
2022-05-06 14:07:42 +00:00
Zuul f5776e6c1c Merge "Fix overwriting of existing tags while creating new tags" 2022-02-17 16:01:16 +00:00
Mridula Joshi a34764ecac Added a new API to expose store info
This patch adds a new API to glance ``GET /v2/info/stores/detail``
to expose the stores specific details about the store like store
type and other specific store properties.This operation
will be admin only and validated by the new policy rule
``stores_info_detail`` which defaults to admin only

Implements: blueprint expose-store-specific-info
Change-Id: I6882fd2381e6ae245fd8c61bf9f4d52df2b216f5
2022-02-16 05:46:47 +00:00
Mridula Joshi 2a9a4c8e0e Fix overwriting of existing tags while creating new tags
It was observed that md-tag-create-multiple
(/v2/metadefs/namespaces/{namespace_name}/tags) API overwrites
existing tags for specified namespace rather than creating new one
in addition to the existing tags.
This patch resolves the issue by introducing a header 'X-Openstack-Append'
which on being True will append the new tags to existing ones and
if False will continue to overwrite the tags.

Implements: blueprint append-tags
Closes-Bug: #1939169
Change-Id: I29448746b14c542e5fbf0283011968ae1516642e
2022-02-16 05:45:06 +00:00
Zuul 88c43d4715 Merge "Cache management API endpoints" 2022-02-15 19:53:47 +00:00
Zuul b085fbecc8 Merge "Remove final six usage" 2022-02-14 20:05:38 +00:00
Erno Kuvaja 87eae327bf Cache management API endpoints
This change adds the new cache API endpoints and their related
new policies.

Implements-bp: https://blueprints.launchpad.net/glance/+spec/cache-api
Change-Id: I69162e19bf095ef11fbac56a1ea2159d1caefba7
2022-02-14 15:14:17 +00:00
Zuul a42fda92dc Merge "[APIImpact] Quota usage API" 2022-02-08 03:33:58 +00:00
Dan Smith f865b8cac7 [APIImpact] Quota usage API
This adds a /v2/info/usage API endpoint which exposes to the user
their current limits and usage.

The discovery API does not (appear to) have existing tests, so this
adds a module for that, although only usage tests are added currently.

Implements: blueprint quota-api
Change-Id: I50c98bac50f815bdb9baae024e77afd388f74554
2022-02-03 09:55:50 -08:00
Stephen Finucane 33741138d9 Remove final six usage
We also update docs since guidance has necessarily changed here.

Change-Id: I7c24a1aa3545f3499a7a2ce30b73e2656666c764
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-01-27 16:37:20 +00:00
Stephen Finucane 87ba56161b Remove six.moves.urllib usage
Change-Id: I71be65ef7b8f710e9317419d7b38559b39f461b0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-01-27 14:54:05 +00:00
Stephen Finucane 9679ffc463 Remove six.moves.http_client usage
This is a rather beefy change due to the number of usages of this
import. The changes are trivial though.

Change-Id: I7badeeaca438b0291f4ed86670e7f217e6372c61
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-01-27 14:54:05 +00:00
Stephen Finucane 6bd7c188ee Remove six.text_type, six.binary_type usage
Change-Id: I2ed464202f8b645aed11490e111c61d3c7423c11
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-01-27 14:54:00 +00:00
Takashi Kajinami 0a5b511729 Use LOG.warning instead of deprecated LOG.warn
The LOG.warn method is deprecated[1] and the LOG.warning method should
be used instead.

[1] https://docs.python.org/3/library/logging.html#logging.warning

Change-Id: Ie0cac63dedf69728392f293f4551e495aebf4d40
2022-01-19 11:36:12 +09:00
Cyril Roelandt 0ca2f92161 Fix typos
Change-Id: I5e7776324c01e467799b1296c35b84dc0c10cce2
2021-10-13 03:02:52 +02:00
Dan Smith 4ee400acca Make signature verification go back to 'queued'
The image state diagram shows that for v2, any image upload failure
results in the image going back to 'queued' state. The old v1 path
used the 'killed' state, which is no longer value in image list
operations for v2. The signature verification error was sending the
image back to killed state still, which results in the user losing
visibility to the image entirely.

This removes the one last way we can get an image into killed state,
but there may still be images in the DB that have been orphaned in
this way, so some cleanup routine will be necesssary.

Change-Id: I9330cc42900dd019e9132c1f4e49eb9eff4f3fc9
Related-Bug: #1924612
2021-09-08 11:50:17 -07:00
Zuul e5d2c41aa7 Merge "Check policies for Image Cache in API" 2021-09-01 16:20:48 +00:00
Zuul 25e60aea8e Merge "Check policies for image tasks information in API" 2021-08-30 17:16:06 +00:00
Zuul ad0cba64be Merge "Move metadef tag policy checks in the API" 2021-08-30 17:08:10 +00:00
Zuul 3c9b4b447f Merge "Move metadef property policy checks in the API" 2021-08-30 17:05:49 +00:00
Abhishek Kekane ea13046919 Check policies for Image Cache in API
This patch enforces policy checks required for caching images
in API layer.

Partially-Implements: blueprint policy-refactor
Depends-On: https://review.opendev.org/c/openstack/nova/+/688802

Change-Id: Ie17b8f5bf308b8f07915ea18ace9b49955b8f0f0
2021-08-30 07:26:51 +00:00
Abhishek Kekane e134d12e74 Move metadef tag policy checks in the API
Moved policy checks for metadef tags in the API layer.
Added additional functional tests for coverage.

Partially implements: blueprint policy-refactor

Depends-On: https://review.opendev.org/c/openstack/nova/+/688802

Change-Id: I22864ddb30b7a9a33a68b2c53606cbead32fa23f
2021-08-30 05:58:41 +00:00
Abhishek Kekane f9deee125c Move metadef property policy checks in the API
Made provision to enforce metadef property related policy
checks in API.

Partially implements: blueprint policy-refactor

Depends-On: https://review.opendev.org/c/openstack/nova/+/688802

Change-Id: I6440462d16006204a5cd46a826dc281fe23ab992
2021-08-30 05:57:51 +00:00
Abhishek Kekane ab0c95da68 Check policies for image tasks information in API
This patch enforces policy checks required for fetching task
information for image in API layer.

Partially-Implements: blueprint policy-refactor
Depends-On: https://review.opendev.org/c/openstack/nova/+/688802

Change-Id: I8f59b8405d9c55b5f69294d3f9bd7bcbc064203f
2021-08-30 05:57:15 +00:00
Abhishek Kekane 869a39d9e5 Check policies for Image Tags in API
This patch enforces policy checks required for adding/deleting tags
for image in API layer.

Partially-Implements: blueprint policy-refactor

Change-Id: I7b5bcbce9375df5b0826120df5cdf5d4cb788af2
2021-08-25 15:38:24 +00:00
Abhishek Kekane 6c87a18d4c Check policies for image import operation in API
This patch enforces policy checks required for importing/copying image
data to store in API layer.

Partially-Implements: blueprint policy-refactor

Change-Id: I18a5187d80bf76c0dc6f22dd8c96a8ffa0f46dc1
2021-08-24 20:09:24 +00:00
Zuul 3e2474676d Merge "Move metadef resource type association policy checks in the API" 2021-08-24 18:31:55 +00:00
Zuul c19be4cab7 Merge "Add missing forbidden to not found case for GET namespace API" 2021-08-24 15:29:15 +00:00
Zuul 646e15da44 Merge "Check add_image policy in the API" 2021-08-24 01:05:48 +00:00
Zuul d23c593303 Merge "Avoid reinitialization of image repo" 2021-08-24 01:05:46 +00:00
Abhishek Kekane 505b08a9bb Avoid reinitialization of image repo
Partially-Implements: blueprint policy-refactor

Change-Id: I0b7abde12cb04ff38c950cb68d7ab903430c8f67
2021-08-23 18:10:37 +00:00