Add etag_quoter middleware support
Change-Id: Id28f47840f46ecdfe463eb718a1fcb823b7ca109
This commit is contained in:
34
manifests/proxy/etag_quoter.pp
Normal file
34
manifests/proxy/etag_quoter.pp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
# Configure swift etag quoter.
|
||||||
|
#
|
||||||
|
# == Parameters
|
||||||
|
#
|
||||||
|
# [*enabled_by_default*]
|
||||||
|
# Enable quoting ETag header cluster-wide by default.
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# == Examples
|
||||||
|
#
|
||||||
|
# class {'swift::proxy::etag_quoter':
|
||||||
|
# enable_by_default => true,
|
||||||
|
# }
|
||||||
|
#
|
||||||
|
# == Authors
|
||||||
|
#
|
||||||
|
# Takashi Kajinami <tkajinam@redhat.com>
|
||||||
|
#
|
||||||
|
# == Copyright
|
||||||
|
#
|
||||||
|
# Copyright (C) 2020 Red Hat
|
||||||
|
#
|
||||||
|
class swift::proxy::etag_quoter (
|
||||||
|
$enabled_by_default = $::os_service_default
|
||||||
|
) {
|
||||||
|
|
||||||
|
include swift::deps
|
||||||
|
|
||||||
|
swift_proxy_config {
|
||||||
|
'filter:etag-quoter/use': value => 'egg:swift#etag_quoter';
|
||||||
|
'filter:etag-quoter/enabled_by_default': value => $enabled_by_default;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Add swift::proxy::etag_quoter to configure etag_quoter middleware for swift
|
||||||
|
proxy.
|
34
spec/classes/swift_proxy_etag_quoter_spec.rb
Normal file
34
spec/classes/swift_proxy_etag_quoter_spec.rb
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'swift::proxy::etag_quoter' do
|
||||||
|
shared_examples 'swift::proxy::etag_quoter' do
|
||||||
|
context 'when using default parameters' do
|
||||||
|
it { is_expected.to contain_swift_proxy_config('filter:etag-quoter/use').with_value('egg:swift#etag_quoter') }
|
||||||
|
it { is_expected.to contain_swift_proxy_config('filter:etag-quoter/enabled_by_default').with_value('<SERVICE DEFAULT>') }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when overriding default parameters' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:enabled_by_default => true
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_swift_proxy_config('filter:etag-quoter/use').with_value('egg:swift#etag_quoter') }
|
||||||
|
it { is_expected.to contain_swift_proxy_config('filter:etag-quoter/enabled_by_default').with_value(true) }
|
||||||
|
end
|
||||||
|
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_behaves_like 'swift::proxy::etag_quoter'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Reference in New Issue
Block a user