From cf0fa5d67980c24d67a72912d54a44f640bbdd4f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 22 Dec 2020 23:39:51 +0900 Subject: [PATCH] Add support for the location parameter of s3api middleware This change introduces support for the location parameter of s3api middleware which is required for v4 signatures calculation. Change-Id: I2b626c3077d037a209b2717962136ce0dddcac80 --- manifests/proxy/s3api.pp | 6 ++++++ releasenotes/notes/s3api-location-4f482f468f484861.yaml | 5 +++++ spec/classes/swift_proxy_s3api_spec.rb | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/s3api-location-4f482f468f484861.yaml diff --git a/manifests/proxy/s3api.pp b/manifests/proxy/s3api.pp index 9c7a6120..f45027f8 100644 --- a/manifests/proxy/s3api.pp +++ b/manifests/proxy/s3api.pp @@ -5,6 +5,10 @@ # # == Parameters # +# [*location*] +# A region name of the swift cluster. +# Defaults to $::os_service_default. +# # [*auth_pipeline_check*] # Enable pipeline order check # Defaults to 'false' @@ -20,6 +24,7 @@ # Defaults to undef # class swift::proxy::s3api( + $location = $::os_service_default, $auth_pipeline_check = false, $max_upload_part_num = 1000, # DEPRECATED PARAMETERS @@ -34,6 +39,7 @@ class swift::proxy::s3api( swift_proxy_config { 'filter:s3api/use': value => 'egg:swift#s3api'; + 'filter:s3api/location': value => $location; 'filter:s3api/auth_pipeline_check': value => $auth_pipeline_check; 'filter:s3api/max_upload_part_num': value => $max_upload_part_num; } diff --git a/releasenotes/notes/s3api-location-4f482f468f484861.yaml b/releasenotes/notes/s3api-location-4f482f468f484861.yaml new file mode 100644 index 00000000..397897cb --- /dev/null +++ b/releasenotes/notes/s3api-location-4f482f468f484861.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``swift::proxy::s3api::location`` parameter has been added to set + a region of the Swift cluster. diff --git a/spec/classes/swift_proxy_s3api_spec.rb b/spec/classes/swift_proxy_s3api_spec.rb index 0324b6e2..2e6a0752 100644 --- a/spec/classes/swift_proxy_s3api_spec.rb +++ b/spec/classes/swift_proxy_s3api_spec.rb @@ -10,6 +10,7 @@ describe 'swift::proxy::s3api' do context 'with default parameters' do it 'configures with default' do is_expected.to contain_swift_proxy_config('filter:s3api/use').with_value('egg:swift#s3api') + is_expected.to contain_swift_proxy_config('filter:s3api/location').with_value('') is_expected.to contain_swift_proxy_config('filter:s3api/auth_pipeline_check').with_value('false') is_expected.to contain_swift_proxy_config('filter:s3api/max_upload_part_num').with_value('1000') end @@ -18,12 +19,14 @@ describe 'swift::proxy::s3api' do context 'with overriding parameters' do before do params.merge!({ + :location => 'regionOne', :auth_pipeline_check => true, :max_upload_part_num => '2000' }) end it 'configures with overridden parameters' do is_expected.to contain_swift_proxy_config('filter:s3api/use').with_value('egg:swift#s3api') + is_expected.to contain_swift_proxy_config('filter:s3api/location').with_value('regionOne') is_expected.to contain_swift_proxy_config('filter:s3api/auth_pipeline_check').with_value('true') is_expected.to contain_swift_proxy_config('filter:s3api/max_upload_part_num').with_value('2000') end