Reviewed: https://review.openstack.org/431709 Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=c74e6bb8ddee8ad1ad2479f3fcfd8396dedef55b Submitter: Jenkins Branch: master
commit c74e6bb8ddee8ad1ad2479f3fcfd8396dedef55b Author: Dharini Chandrasekar <dharini.chandrase...@intel.com> Date: Thu Feb 9 18:34:02 2017 +0000 Prevent v1_api from making requests to v2_registry In glance v2, when one opts to use v2_registry, it is required that 'data_api' is set to 'glance.db.registry.api'. This is returned by method 'get_api()' which currently simply returns whatever is provided to 'data_api'. This is suitable for v2. But when using v1, this same method is used to fetch the db api. This returns 'glance.db.registry.api' which inturn relies on the registry rpc client (v2). To prevent this, this patch proposes to change what get_api() will return based on whether it is serving v1 api or v2 api. Change-Id: Ifef36859b3f7692769a6991364b6063c9f7cc451 Closes-Bug: 1516706 ** Changed in: glance Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/1516706 Title: Glance v1 API makes requests to the v2 registry Status in Glance: Fix Released Bug description: If I configure storage quotas with: user_storage_quota = 6 And I enable the v2 registry: data_api = glance.db.registry.api Then a v1 image create: $ glance --os-image-api-version 1 image-create --name x3 --disk-format raw --container-format bare --file /etc/fstab 413 Request Entity Too Large: Denying attempt to upload image because it exceeds the quota: The size of the data 145 will exceed the limit. -5794 bytes remaining. (HTTP 413) Generates the following request to the v2 registry: POST /rpc HTTP/1.1. Host: 0.0.0.0:9191. Accept-Encoding: identity. Content-Length: 151. x-auth-token: bee70651417c474dac02d6e4e4a5b9fc. . [{"command": "user_get_storage_usage", "kwargs": {"image_id": "c4252759-9c2f-4858-b23a-1b4c87f7b155", "owner_id": "411423405e10431fb9c47ac5b2446557"}}] Amusingly, this works. But I'm pretty sure it's not what we intended. To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1516706/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp