Allow setting endpoint_type for glance
currently Manila always uses public endpoint of Glance, which may not be possible in certain deployment scenarios. Change-Id: Ic17ac43160092445ec11ada41c0eb6eaf525b6d0 Closes-Bug: #1991396
This commit is contained in:
parent
486289d27e
commit
111104b9a2
@ -35,6 +35,9 @@ glance_opts = [
|
|||||||
cfg.StrOpt('region_name',
|
cfg.StrOpt('region_name',
|
||||||
default='RegionOne',
|
default='RegionOne',
|
||||||
help='Region name for connecting to glance.'),
|
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
|
CONF = cfg.CONF
|
||||||
@ -55,6 +58,7 @@ def glanceclient(context):
|
|||||||
client_class=glance_client.Client, cfg_group=GLANCE_GROUP)
|
client_class=glance_client.Client, cfg_group=GLANCE_GROUP)
|
||||||
return AUTH_OBJ.get_client(context,
|
return AUTH_OBJ.get_client(context,
|
||||||
version=CONF[GLANCE_GROUP].api_microversion,
|
version=CONF[GLANCE_GROUP].api_microversion,
|
||||||
|
interface=CONF[GLANCE_GROUP].endpoint_type,
|
||||||
region_name=CONF[GLANCE_GROUP].region_name)
|
region_name=CONF[GLANCE_GROUP].region_name)
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ class GlanceClientTestCase(test.TestCase):
|
|||||||
data = {
|
data = {
|
||||||
'glance': {
|
'glance': {
|
||||||
'api_microversion': 'foo_api_microversion',
|
'api_microversion': 'foo_api_microversion',
|
||||||
|
'endpoint_type': 'internal',
|
||||||
'region_name': 'foo_region_name'
|
'region_name': 'foo_region_name'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,6 +64,7 @@ class GlanceClientTestCase(test.TestCase):
|
|||||||
mock_client_loader.return_value.get_client.assert_called_once_with(
|
mock_client_loader.return_value.get_client.assert_called_once_with(
|
||||||
fake_context,
|
fake_context,
|
||||||
version=data['glance']['api_microversion'],
|
version=data['glance']['api_microversion'],
|
||||||
|
interface=data['glance']['endpoint_type'],
|
||||||
region_name=data['glance']['region_name']
|
region_name=data['glance']['region_name']
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -72,6 +74,7 @@ class GlanceClientTestCase(test.TestCase):
|
|||||||
data = {
|
data = {
|
||||||
'glance': {
|
'glance': {
|
||||||
'api_microversion': 'foo_api_microversion',
|
'api_microversion': 'foo_api_microversion',
|
||||||
|
'endpoint_type': 'internal',
|
||||||
'region_name': 'foo_region_name'
|
'region_name': 'foo_region_name'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,6 +85,7 @@ class GlanceClientTestCase(test.TestCase):
|
|||||||
glance.AUTH_OBJ.get_client.assert_called_once_with(
|
glance.AUTH_OBJ.get_client.assert_called_once_with(
|
||||||
fake_context,
|
fake_context,
|
||||||
version=data['glance']['api_microversion'],
|
version=data['glance']['api_microversion'],
|
||||||
|
interface=data['glance']['endpoint_type'],
|
||||||
region_name=data['glance']['region_name']
|
region_name=data['glance']['region_name']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -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>`_).
|
Loading…
Reference in New Issue
Block a user