Merge "Allow setting endpoint_type for glance" into stable/wallaby

This commit is contained in:
Zuul 2023-02-20 22:47:29 +00:00 committed by Gerrit Code Review
commit f8529a58c0
3 changed files with 15 additions and 0 deletions

View File

@ -35,6 +35,9 @@ glance_opts = [
cfg.StrOpt('region_name',
default='RegionOne',
help='Region name for connecting to glance.'),
cfg.StrOpt('endpoint_type',
default='publicURL',
help='Endpoint type to be used with glance client calls.'),
]
CONF = cfg.CONF
@ -55,6 +58,7 @@ def glanceclient(context):
client_class=glance_client.Client, cfg_group=GLANCE_GROUP)
return AUTH_OBJ.get_client(context,
version=CONF[GLANCE_GROUP].api_microversion,
interface=CONF[GLANCE_GROUP].endpoint_type,
region_name=CONF[GLANCE_GROUP].region_name)

View File

@ -49,6 +49,7 @@ class GlanceClientTestCase(test.TestCase):
data = {
'glance': {
'api_microversion': 'foo_api_microversion',
'endpoint_type': 'internal',
'region_name': 'foo_region_name'
}
}
@ -63,6 +64,7 @@ class GlanceClientTestCase(test.TestCase):
mock_client_loader.return_value.get_client.assert_called_once_with(
fake_context,
version=data['glance']['api_microversion'],
interface=data['glance']['endpoint_type'],
region_name=data['glance']['region_name']
)
@ -72,6 +74,7 @@ class GlanceClientTestCase(test.TestCase):
data = {
'glance': {
'api_microversion': 'foo_api_microversion',
'endpoint_type': 'internal',
'region_name': 'foo_region_name'
}
}
@ -82,6 +85,7 @@ class GlanceClientTestCase(test.TestCase):
glance.AUTH_OBJ.get_client.assert_called_once_with(
fake_context,
version=data['glance']['api_microversion'],
interface=data['glance']['endpoint_type'],
region_name=data['glance']['region_name']
)

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Deployers now can specify ``[glance]endpoint_type`` configuration option
(defaults to ``publicURL`` for backward compatibility)
so that Manila uses Glance endpoint other than the public one
(see `bug 1991396 <https://bugs.launchpad.net/manila/+bug/1991396>`_).