From f24fd8c73edb3e6892c68de072861ce7237ad6d8 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 28 Apr 2020 21:27:54 +0900 Subject: [PATCH] Deprecate support for swift3 middlware ... because swift3 is no longer maintained since s3api middleware was merged into swift. Change-Id: I287258ee6ee24a6f44d2e22d01c798da570d1fa8 --- examples/site.pp | 4 ++-- manifests/params.pp | 2 -- manifests/proxy.pp | 6 ++++++ manifests/proxy/swift3.pp | 18 +++++------------- .../deprecate-swift3-ccc754b60e6ab25d.yaml | 11 +++++++++++ spec/classes/swift_proxy_spec.rb | 12 ++++++++++++ spec/classes/swift_proxy_swift3_spec.rb | 19 ------------------- 7 files changed, 36 insertions(+), 36 deletions(-) create mode 100644 releasenotes/notes/deprecate-swift3-ccc754b60e6ab25d.yaml delete mode 100644 spec/classes/swift_proxy_swift3_spec.rb diff --git a/examples/site.pp b/examples/site.pp index 5a13ddab..01639aba 100644 --- a/examples/site.pp +++ b/examples/site.pp @@ -207,7 +207,7 @@ node /swift-proxy/ { 'healthcheck', 'cache', 'ratelimit', - 'swift3', + 's3api', 's3token', 'authtoken', 'keystone', @@ -226,7 +226,7 @@ node /swift-proxy/ { '::swift::proxy::container_quotas', '::swift::proxy::healthcheck', '::swift::proxy::cache', - '::swift::proxy::swift3', + '::swift::proxy::s3api', ]: } class { 'swift::proxy::bulk': max_containers_per_extraction => 10000, diff --git a/manifests/params.pp b/manifests/params.pp index a46a79c5..8a85cd8f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -34,7 +34,6 @@ class swift::params { $account_auditor_service_name = 'swift-account-auditor' $account_reaper_service_name = 'swift-account-reaper' $account_replicator_service_name = 'swift-account-replicator' - $swift3 = 'swift-plugin-s3' if ($::os_package_type == 'debian') { $signing_dir = '/var/lib/swift' }else{ @@ -65,7 +64,6 @@ class swift::params { $account_auditor_service_name = 'openstack-swift-account-auditor' $account_reaper_service_name = 'openstack-swift-account-reaper' $account_replicator_service_name = 'openstack-swift-account-replicator' - $swift3 = 'openstack-swift-plugin-swift3' $signing_dir = '/var/cache/swift' } default: { diff --git a/manifests/proxy.pp b/manifests/proxy.pp index 73e0b979..5cecabf9 100644 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -207,6 +207,12 @@ class swift::proxy( warning('pipeline parameter must contain proxy-server') } + # TODO(tkajinam): Remove this when we remove swift::proxy::swift3 + if member($pipeline, 'swift3') { + fail('swift3 is no longer supported by puppet-swift. Use s3api middleware \ +and swift::proxy::s3api instead') + } + if($auth_type == 'tempauth' and ! $account_autocreate ){ fail('account_autocreate must be set to true when auth_type is tempauth') } diff --git a/manifests/proxy/swift3.pp b/manifests/proxy/swift3.pp index 8c438449..c02afa23 100644 --- a/manifests/proxy/swift3.pp +++ b/manifests/proxy/swift3.pp @@ -1,4 +1,5 @@ # +# DEPRECATED! # Configure swift swift3. # # == Dependencies @@ -7,7 +8,7 @@ # # [*ensure*] # Enable or not swift3 middleware -# Defaults to 'present' +# Defaults to undef # # == Examples # @@ -21,19 +22,10 @@ # Copyright 2012 eNovance licensing@enovance.com # class swift::proxy::swift3( - $ensure = 'present' + $ensure = undef ) { - include swift::deps - include swift::params + warning('swift::proxy::swift3 is deprecated and has no effect. \ +Use swift::proxy::s3api to use s3api middleware implemented in swift.') - package { 'swift-plugin-s3': - ensure => $ensure, - name => $::swift::params::swift3, - tag => ['openstack','swift-package'] - } - - swift_proxy_config { - 'filter:swift3/use': value => 'egg:swift3#swift3'; - } } diff --git a/releasenotes/notes/deprecate-swift3-ccc754b60e6ab25d.yaml b/releasenotes/notes/deprecate-swift3-ccc754b60e6ab25d.yaml new file mode 100644 index 00000000..8769bf70 --- /dev/null +++ b/releasenotes/notes/deprecate-swift3-ccc754b60e6ab25d.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - | + puppet-swift now fails if swift3 is included in ``swift::proxy::pipeline``, + because it no longer supports configuration for swift3 middleware. Use + s3api instead to provide S3-compatible API. +deprecations: + - | + The ``swift::proxy::swift3`` class has been deprecated because swift3 + middleware is no longer maintained. Use ``swift::proxy::s3api`` instead + to use built-in s3api middleware in swift. diff --git a/spec/classes/swift_proxy_spec.rb b/spec/classes/swift_proxy_spec.rb index c1f0dfe5..e5bdca5b 100644 --- a/spec/classes/swift_proxy_spec.rb +++ b/spec/classes/swift_proxy_spec.rb @@ -253,6 +253,18 @@ describe 'swift::proxy' do should raise_error(Puppet::Error, /write_affinity_node_count requires write_affinity/) end end + + describe 'when unsupported swift3 is used' do + let :params do + { + :pipeline => ['swift3', 'swauth', 'proxy-server'] + } + end + + it 'should fail if swift3 is included in pipeline' do + should raise_error(Puppet::Error) + end + end end end end diff --git a/spec/classes/swift_proxy_swift3_spec.rb b/spec/classes/swift_proxy_swift3_spec.rb deleted file mode 100644 index 8e016f9c..00000000 --- a/spec/classes/swift_proxy_swift3_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe 'swift::proxy::swift3' do - shared_examples 'swift::proxy::swift3' do - it { is_expected.to contain_swift_proxy_config('filter:swift3/use').with_value('egg:swift3#swift3') } - end - - on_supported_os({ - :supported_os => OSDefaults.get_supported_os - }).each do |os,facts| - context "on #{os}" do - let (:facts) do - facts.merge(OSDefaults.get_facts()) - end - - it_configures 'swift::proxy::swift3' - end - end -end