Bump Images API version to 2.17

Related blueprint new-location-apis

Change-Id: I6e7bdc2d092c32c060d2f3c72fc83cecc73ee7f6
This commit is contained in:
Pranali Deore 2023-08-04 06:43:09 +00:00
parent cedf499e86
commit 6f4d9c4346
3 changed files with 28 additions and 9 deletions

View File

@ -92,6 +92,7 @@ class VersionNegotiationFilter(wsgi.Middleware):
allowed_versions['v2.11'] = 2
allowed_versions['v2.12'] = 2
allowed_versions['v2.13'] = 2
allowed_versions['v2.17'] = 2
return allowed_versions
def _match_version_string(self, subject):

View File

@ -79,13 +79,13 @@ class Controller(object):
version_objs = []
if CONF.image_cache_dir:
version_objs.extend([
build_version_object('2.16', 'v2', 'CURRENT'),
build_version_object('2.16', 'v2', 'SUPPORTED'),
build_version_object('2.15', 'v2', 'SUPPORTED'),
build_version_object('2.14', 'v2', 'SUPPORTED'),
])
else:
version_objs.extend([
build_version_object('2.15', 'v2', 'CURRENT'),
build_version_object('2.15', 'v2', 'SUPPORTED'),
])
if CONF.enabled_backends:
version_objs.extend([
@ -101,6 +101,7 @@ class Controller(object):
build_version_object('2.9', 'v2', 'SUPPORTED'),
])
version_objs.extend([
build_version_object('2.17', 'v2', 'CURRENT'),
build_version_object('2.7', 'v2', 'SUPPORTED'),
build_version_object('2.6', 'v2', 'SUPPORTED'),
build_version_object('2.5', 'v2', 'SUPPORTED'),

View File

@ -32,7 +32,7 @@ def get_versions_list(url, enabled_backends=False,
image_versions = [
{
'id': 'v2.15',
'status': 'CURRENT',
'status': 'SUPPORTED',
'links': [{'rel': 'self',
'href': '%s/v2/' % url}],
},
@ -42,6 +42,12 @@ def get_versions_list(url, enabled_backends=False,
'links': [{'rel': 'self',
'href': '%s/v2/' % url}],
},
{
'id': 'v2.17',
'status': 'CURRENT',
'links': [{'rel': 'self',
'href': '%s/v2/' % url}],
},
{
'id': 'v2.7',
'status': 'SUPPORTED',
@ -95,7 +101,7 @@ def get_versions_list(url, enabled_backends=False,
image_versions = [
{
'id': 'v2.15',
'status': 'CURRENT',
'status': 'SUPPORTED',
'links': [{'rel': 'self',
'href': '%s/v2/' % url}],
},
@ -147,7 +153,7 @@ def get_versions_list(url, enabled_backends=False,
})
image_versions.insert(0, {
'id': 'v2.16',
'status': 'CURRENT',
'status': 'SUPPORTED',
'links': [{'rel': 'self',
'href': '%s/v2/' % url}],
})
@ -377,15 +383,26 @@ class VersionNegotiationTest(base.IsolatedUnitTest):
self.middleware.process_request(request)
self.assertEqual('/v2/images', request.path_info)
# version 2.17 does not exist
def test_request_url_v2_17_default_unsupported(self):
def test_request_url_v2_17_default_supported(self):
request = webob.Request.blank('/v2.17/images')
self.middleware.process_request(request)
self.assertEqual('/v2/images', request.path_info)
def test_request_url_v2_17_enabled_supported(self):
self.config(enabled_backends='slow:one,fast:two')
request = webob.Request.blank('/v2.17/images')
self.middleware.process_request(request)
self.assertEqual('/v2/images', request.path_info)
# version 2.18 does not exist
def test_request_url_v2_18_default_unsupported(self):
request = webob.Request.blank('/v2.18/images')
resp = self.middleware.process_request(request)
self.assertIsInstance(resp, versions.Controller)
def test_request_url_v2_17_enabled_unsupported(self):
def test_request_url_v2_18_enabled_unsupported(self):
self.config(enabled_backends='slow:one,fast:two')
request = webob.Request.blank('/v2.17/images')
request = webob.Request.blank('/v2.18/images')
resp = self.middleware.process_request(request)
self.assertIsInstance(resp, versions.Controller)