Add new option for api: public_endpoint
When running glance-api behind a proxy or load balancer that hides glance behind an extended base URL, it is necessary to provide information about the base URL to glance-api to ensure that clients know where to pass subsequent requests. Change-Id: I9bebee01c2580f0500a069f5ab57ac2a8c329389
This commit is contained in:
parent
b1a6e9c61e
commit
709b83b390
|
@ -225,6 +225,14 @@
|
|||
# by the user executing the agent
|
||||
# Defaults to: $::glance::params::lock_path
|
||||
#
|
||||
# [*public_endpoint*]
|
||||
# (optional) Public url endpoint to use for Glance versions response.
|
||||
# Change the endpoint to represent the proxy URL if the API service is
|
||||
# running behind a proxy. This is especially useful if the public endpoint
|
||||
# is advertised with a base URL not pointing to the server root in Keystone.
|
||||
# ie. https://cloud.acme.org/api/image
|
||||
# Default: $::os_service_default.
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*stores*]
|
||||
|
@ -342,6 +350,7 @@ class glance::api(
|
|||
$limit_param_default = $::os_service_default,
|
||||
$api_limit_max = $::os_service_default,
|
||||
$lock_path = $::glance::params::lock_path,
|
||||
$public_endpoint = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$stores = undef,
|
||||
$default_store = undef,
|
||||
|
@ -435,6 +444,7 @@ class glance::api(
|
|||
'DEFAULT/user_storage_quota': value => $user_storage_quota;
|
||||
'DEFAULT/limit_param_default': value => $limit_param_default;
|
||||
'DEFAULT/api_limit_max': value => $api_limit_max;
|
||||
'DEFAULT/public_endpoint': value => $public_endpoint;
|
||||
}
|
||||
|
||||
if $show_multiple_locations {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The ``glance::api`` class accepts a new parameter ``public_endpoint``.
|
||||
This is especially useful if you have a proxy or load balancer that
|
||||
rewrites the base URL of the image API. If the image API is advertised as
|
||||
``https://cloud.acme.org/api/image`` in Keystone, you will need to set
|
||||
this option to the full value of the endpoint to have glance API
|
||||
advertise the correct URLs to clients.
|
|
@ -54,6 +54,7 @@ describe 'glance::api' do
|
|||
:sync_db => true,
|
||||
:limit_param_default => '<SERVICE DEFAULT>',
|
||||
:api_limit_max => '<SERVICE DEFAULT>',
|
||||
:public_endpoint => '<SERVICE DEFAULT>',
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -96,6 +97,7 @@ describe 'glance::api' do
|
|||
:sync_db => false,
|
||||
:limit_param_default => '10',
|
||||
:api_limit_max => '10',
|
||||
:public_endpoint => 'https://cloud.acme.org/api/image',
|
||||
}
|
||||
].each do |param_set|
|
||||
|
||||
|
@ -155,6 +157,7 @@ describe 'glance::api' do
|
|||
'user_storage_quota',
|
||||
'limit_param_default',
|
||||
'api_limit_max',
|
||||
'public_endpoint',
|
||||
].each do |config|
|
||||
is_expected.to contain_glance_api_config("DEFAULT/#{config}").with_value(param_hash[config.intern])
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue