Deprecate keystone::endpoint::version
With the move to Keystone v3 API, let's deprecate version parameter and set it to undef by default, so it will deploy Keystone versionless endpoints. Keep the capacity to set it to 'unset' so v2.0 will still be created, so our users have a path of migration. Though this patch changes the default value so from now, endpoints will be created by default without version. If this patch breaks you, set version to 'unset' and think about a migration to Keystone v3. Change-Id: Ic2f741589bfbd687417e086379fc2fe60eba2024
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
#
|
#
|
||||||
# [*version*]
|
# [*version*]
|
||||||
# (optional) API version for endpoint.
|
# (optional) API version for endpoint.
|
||||||
# Defaults to 'v2.0'. Valid values are 'v2.0', 'v3', or the empty string ''.
|
# Defaults to ''. Valid values are 'v2.0', 'v3', or the empty string ''.
|
||||||
# If the version is set to the empty string (''), then it won't be
|
# If the version is set to the empty string (''), then it won't be
|
||||||
# used. This is the expected behaviour since Keystone V3 handles API versions
|
# used. This is the expected behaviour since Keystone V3 handles API versions
|
||||||
# from the context.
|
# from the context.
|
||||||
@@ -59,17 +59,13 @@ class keystone::endpoint (
|
|||||||
$user_domain = undef,
|
$user_domain = undef,
|
||||||
$project_domain = undef,
|
$project_domain = undef,
|
||||||
$default_domain = undef,
|
$default_domain = undef,
|
||||||
$version = 'unset', # defaults to 'v2.0' if unset by user
|
$version = '',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::keystone::deps
|
include ::keystone::deps
|
||||||
|
|
||||||
if $version == 'unset' {
|
if $version == 'unset' {
|
||||||
# $version will be set to empty '' once tempest & all openstack clients
|
warning('keystone::endpoint::version parameter is deprecated and will be removed in a future release.')
|
||||||
# actually support versionless endpoints.
|
|
||||||
# See ongoing work in Tempest:
|
|
||||||
# https://review.openstack.org/#/q/status:open+project:openstack/tempest-lib+branch:master+topic:bug/1530181
|
|
||||||
# Until that, we need to set a version by default.
|
|
||||||
$_version = 'v2.0'
|
$_version = 'v2.0'
|
||||||
} else {
|
} else {
|
||||||
$_version = $version
|
$_version = $version
|
||||||
|
9
releasenotes/notes/keystonev3-919f2e4842670c0f.yaml
Normal file
9
releasenotes/notes/keystonev3-919f2e4842670c0f.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- keystone::endpoint::version is not default to undef which means
|
||||||
|
Keystone endpoints will be versionless by default, so it enables
|
||||||
|
services to reach Keystone v3 with is the current stable version.
|
||||||
|
Therefore, we don't need the version parameter, so we deprecate it
|
||||||
|
in this cycle and will remove it later.
|
||||||
|
If the user used to set 'unset' to $version, it will keep v2.0 endpoint
|
||||||
|
but a migration to undef is recommended.
|
@@ -10,9 +10,9 @@ describe 'keystone::endpoint' do
|
|||||||
describe 'with default parameters' do
|
describe 'with default parameters' do
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/keystone::identity').with(
|
it { is_expected.to contain_keystone_endpoint('RegionOne/keystone::identity').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:public_url => 'http://127.0.0.1:5000/v2.0',
|
:public_url => 'http://127.0.0.1:5000',
|
||||||
:admin_url => 'http://127.0.0.1:35357/v2.0',
|
:admin_url => 'http://127.0.0.1:35357',
|
||||||
:internal_url => 'http://127.0.0.1:5000/v2.0',
|
:internal_url => 'http://127.0.0.1:5000',
|
||||||
:region => 'RegionOne'
|
:region => 'RegionOne'
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
@@ -37,18 +37,16 @@ describe 'keystone::endpoint' do
|
|||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'without a version' do
|
describe 'with unset version to test backward compatibility' do
|
||||||
# We need to test empty value '' to override the default value, using undef
|
|
||||||
# cannot un-set classes parameters.
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :version => '' }
|
{ :version => 'unset' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_keystone_endpoint('RegionOne/keystone::identity').with(
|
it { is_expected.to contain_keystone_endpoint('RegionOne/keystone::identity').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:public_url => 'http://127.0.0.1:5000',
|
:public_url => 'http://127.0.0.1:5000/v2.0',
|
||||||
:admin_url => 'http://127.0.0.1:35357',
|
:admin_url => 'http://127.0.0.1:35357/v2.0',
|
||||||
:internal_url => 'http://127.0.0.1:5000'
|
:internal_url => 'http://127.0.0.1:5000/v2.0'
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -61,8 +59,8 @@ describe 'keystone::endpoint' do
|
|||||||
it 'internal_url should default to public_url' do
|
it 'internal_url should default to public_url' do
|
||||||
is_expected.to contain_keystone_endpoint('RegionOne/keystone::identity').with(
|
is_expected.to contain_keystone_endpoint('RegionOne/keystone::identity').with(
|
||||||
:ensure => 'present',
|
:ensure => 'present',
|
||||||
:public_url => 'https://identity.some.tld/the/main/endpoint/v2.0',
|
:public_url => 'https://identity.some.tld/the/main/endpoint',
|
||||||
:internal_url => 'https://identity.some.tld/the/main/endpoint/v2.0'
|
:internal_url => 'https://identity.some.tld/the/main/endpoint'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user