Skip to content

Commit df75755

Browse files
CIDM-1566 - Add via-header and repose-version to container config
1 parent f11a75f commit df75755

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

manifests/filter/container.pp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,20 @@
189189
#
190190
# [*via*]
191191
# String. String used in the Via header.
192+
# Depreciated, to be removed in Repose 9.0.0.0
192193
# Defaults to <tt>undef</tt>
193194
#
195+
# [*via_header*]
196+
# String. String used in the Via header.
197+
# Requires Repose version 8.4.1.0 or higher
198+
# Defaults to <tt>undef</tt>
199+
#
200+
# [*repose_version*]
201+
# String. string (true or false) to define if the version is displayed in
202+
# the Via header defaults to true to maintain default behavior if undefined.
203+
# Requires Repose version 8.4.1.0 or higher
204+
# Defaults to <tt>true</tt>
205+
#
194206
# [*log_herp_flume*]
195207
# Enable herp filter publishing to flume.
196208
# Defaults to <tt>false</tt>
@@ -311,6 +323,7 @@
311323
$syslog_port = $repose::params::syslog_port,
312324
$syslog_protocol = $repose::params::syslog_protocol,
313325
$via = undef,
326+
$via_header = undef,
314327
$flume_host = $repose::params::flume_host,
315328
$flume_port = $repose::params::flume_port,
316329
# BELOW ARE DEPRECATED
@@ -320,6 +333,7 @@
320333
$connection_timeout = undef,
321334
$read_timeout = undef,
322335
$proxy_thread_pool = undef,
336+
$repose_version = 'true',
323337
) inherits repose::params {
324338

325339
### Validate parameters

puppet-module-repose.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%define base_name repose
33

44
Name: puppet-module-%{user}-%{base_name}
5-
Version: 2.8.0
5+
Version: 2.9.0
66
Release: 1
77
BuildArch: noarch
88
Summary: Puppet module to configure %{base_name}
@@ -30,6 +30,8 @@ cp -pr * %{buildroot}%{module_dir}/
3030
%{module_dir}
3131

3232
%changelog
33+
* Mon Dec 17 2018 Josh Bell <josh.bell@rackspace.com> - 2.9.0-1
34+
- Add via_header and repose_version options to container filter
3335
* Mon May 12 2018 Josh Bell <josh.bell@rackspace.com> - 2.8.0-1
3436
- Add ssl protocol and tls renegotiation options to container filter
3537
* Mon Apr 02 2018 Dimitry Ushakov <dimitry.ushakov@rackspace.com> - 2.7.0-1

spec/classes/filter/container_spec.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
let(:params) { {
6969
:app_name => 'app',
7070
:via => 'my app',
71+
:repose_version => 'true',
7172
:deployment_directory => '/deployment_dir',
7273
:deployment_directory_auto_clean => 'false',
7374
:artifact_directory => '/artifact_dir',
@@ -97,6 +98,7 @@
9798
with_content(/http-port="10000"/).
9899
with_content(/https-port="10001"/).
99100
with_content(/via="my app"/).
101+
with_content(/repose-version="true"/).
100102
with_content(/content-body-read-limit="10240000"/).
101103
with_content(/connection-timeout="40000"/).
102104
with_content(/read-timeout="1000"/).
@@ -397,6 +399,28 @@
397399
}
398400
end
399401

402+
context 'define via_header option' do
403+
let(:params) { {
404+
:app_name => 'app',
405+
:via_header => 'Potato'
406+
} }
407+
it {
408+
should contain_file('/etc/repose/container.cfg.xml').
409+
with_content(/via-header="Potato"/)
410+
}
411+
end
412+
413+
context 'define repose_version as false' do
414+
let(:params) { {
415+
:app_name => 'app',
416+
:repose_version => 'false'
417+
} }
418+
it {
419+
should contain_file('/etc/repose/container.cfg.xml').
420+
with_content(/repose-version="false"/)
421+
}
422+
end
423+
400424
context 'with defaults with old namespace' do
401425
let :pre_condition do
402426
"class { 'repose': cfg_new_namespace => false }"

templates/container.cfg.xml.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
<%- if @via -%>
1313
via="<%= @via %>"
1414
<%- end -%>
15+
<%- if @via_header -%>
16+
via-header="<%= @via_header %>"
17+
<%- end -%>
1518
<%- if @content_body_read_limit -%>
1619
content-body-read-limit="<%= @content_body_read_limit %>"
1720
<%- end -%>
@@ -30,6 +33,7 @@
3033
<%- if @jmx_reset_time -%>
3134
jmx-reset-time="<%= @jmx_reset_time -%>"
3235
<%- end -%>
36+
repose-version="<%= @repose_version %>"
3337
>
3438

3539
<deployment-directory auto-clean="<%= @deployment_directory_auto_clean %>"><%= @deployment_directory %></deployment-directory>

0 commit comments

Comments
 (0)