From 471f9ff9a04427c7b8b5a07f566ce511eba95678 Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Wed, 14 Aug 2024 08:03:06 -0400 Subject: [PATCH 1/3] Disable reverse proxy by default --- ...115647-disable-reverse-proxy-by-default.rb | 3 +++ ...7-disable_reverse_proxy_by_default_spec.rb | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 config/foreman-proxy-content.migrations/240814115647-disable-reverse-proxy-by-default.rb create mode 100644 spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb diff --git a/config/foreman-proxy-content.migrations/240814115647-disable-reverse-proxy-by-default.rb b/config/foreman-proxy-content.migrations/240814115647-disable-reverse-proxy-by-default.rb new file mode 100644 index 00000000..d701d628 --- /dev/null +++ b/config/foreman-proxy-content.migrations/240814115647-disable-reverse-proxy-by-default.rb @@ -0,0 +1,3 @@ +if answers['foreman_proxy_content'].is_a?(Hash) + answers['foreman_proxy_content'].delete('reverse_proxy') +end diff --git a/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb b/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb new file mode 100644 index 00000000..4b65547b --- /dev/null +++ b/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +migration '240814115647-disable-reverse-proxy-by-default' do + scenarios %w[foreman-proxy-content] do + context 'reset reverse_proxy to default value to disable by default' do + let(:answers) do + { + 'foreman_proxy_content' => { + 'reverse_proxy' => true, + }, + } + end + + it 'changes the default to the puppet module' do + expect(migrated_answers['foreman_proxy_content']['reverse_proxy']).to eq(nil) + end + end + end +end From 83a55b5287c0dffc164dab75290a8823e8f2885b Mon Sep 17 00:00:00 2001 From: Eric Helms Date: Wed, 14 Aug 2024 10:16:32 -0400 Subject: [PATCH 2/3] Update spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb Co-authored-by: Ewoud Kohl van Wijngaarden --- .../240814115647-disable_reverse_proxy_by_default_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb b/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb index 4b65547b..71c38bb9 100644 --- a/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb +++ b/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb @@ -11,7 +11,7 @@ } end - it 'changes the default to the puppet module' do + it 'removes the stored answer' do expect(migrated_answers['foreman_proxy_content']['reverse_proxy']).to eq(nil) end end From 672ebc90315c32da5af8e3079d0afbdfff6ee296 Mon Sep 17 00:00:00 2001 From: Eric Helms Date: Wed, 14 Aug 2024 10:17:02 -0400 Subject: [PATCH 3/3] Update spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb Co-authored-by: Ewoud Kohl van Wijngaarden --- .../240814115647-disable_reverse_proxy_by_default_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb b/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb index 71c38bb9..0b1f53fa 100644 --- a/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb +++ b/spec/migrations/240814115647-disable_reverse_proxy_by_default_spec.rb @@ -2,7 +2,7 @@ migration '240814115647-disable-reverse-proxy-by-default' do scenarios %w[foreman-proxy-content] do - context 'reset reverse_proxy to default value to disable by default' do + context 'with a stored answer' do let(:answers) do { 'foreman_proxy_content' => {