From f5d1ba984420c4fcbc87fc0d91e0fd2e4b402bd8 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 26 Feb 2024 01:51:46 +0900 Subject: [PATCH] healthcheck: Expose ignore_proxied_requests parameter Depends-on: https://review.opendev.org/909807 Change-Id: Iccfc9100684e07d25750a95e238b73de9f70ccf3 --- manifests/healthcheck.pp | 28 +++++++++------ ...ore_proxied_requests-a52d17b5c7ca1818.yaml | 5 +++ spec/classes/mistral_healthcheck_spec.rb | 35 ++++++++++--------- 3 files changed, 41 insertions(+), 27 deletions(-) create mode 100644 releasenotes/notes/healthcheck-ignore_proxied_requests-a52d17b5c7ca1818.yaml diff --git a/manifests/healthcheck.pp b/manifests/healthcheck.pp index 09ba278..8dbcd52 100644 --- a/manifests/healthcheck.pp +++ b/manifests/healthcheck.pp @@ -22,6 +22,10 @@ # healthcheck information. # Defaults to $facts['os_service_default'] # +# [*ignore_proxied_requests*] +# (Optional) Ignore requests with proxy headers +# Defaults to $facts['os_service_default'] +# # [*disable_by_file_path*] # (Optional) Check the presense of a file to determine if an application # is running on a port. @@ -33,12 +37,13 @@ # Defaults to $facts['os_service_default'] # class mistral::healthcheck ( - $enabled = $facts['os_service_default'], - $detailed = $facts['os_service_default'], - $backends = $facts['os_service_default'], - $allowed_source_ranges = $facts['os_service_default'], - $disable_by_file_path = $facts['os_service_default'], - $disable_by_file_paths = $facts['os_service_default'], + $enabled = $facts['os_service_default'], + $detailed = $facts['os_service_default'], + $backends = $facts['os_service_default'], + $allowed_source_ranges = $facts['os_service_default'], + $ignore_proxied_requests = $facts['os_service_default'], + $disable_by_file_path = $facts['os_service_default'], + $disable_by_file_paths = $facts['os_service_default'], ) { include mistral::deps @@ -48,10 +53,11 @@ class mistral::healthcheck ( } oslo::healthcheck { 'mistral_config': - detailed => $detailed, - backends => $backends, - allowed_source_ranges => $allowed_source_ranges, - disable_by_file_path => $disable_by_file_path, - disable_by_file_paths => $disable_by_file_paths, + detailed => $detailed, + backends => $backends, + allowed_source_ranges => $allowed_source_ranges, + ignore_proxied_requests => $ignore_proxied_requests, + disable_by_file_path => $disable_by_file_path, + disable_by_file_paths => $disable_by_file_paths, } } diff --git a/releasenotes/notes/healthcheck-ignore_proxied_requests-a52d17b5c7ca1818.yaml b/releasenotes/notes/healthcheck-ignore_proxied_requests-a52d17b5c7ca1818.yaml new file mode 100644 index 0000000..004ebc7 --- /dev/null +++ b/releasenotes/notes/healthcheck-ignore_proxied_requests-a52d17b5c7ca1818.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``mistral::healthcheck::ignore_proxied_requests`` parameter has + been added. diff --git a/spec/classes/mistral_healthcheck_spec.rb b/spec/classes/mistral_healthcheck_spec.rb index 268a0bd..95c70c9 100644 --- a/spec/classes/mistral_healthcheck_spec.rb +++ b/spec/classes/mistral_healthcheck_spec.rb @@ -13,11 +13,12 @@ describe 'mistral::healthcheck' do is_expected.to contain_mistral_config('healthcheck/enabled').with_value('') is_expected.to contain_oslo__healthcheck('mistral_config').with( - :detailed => '', - :backends => '', - :allowed_source_ranges => '', - :disable_by_file_path => '', - :disable_by_file_paths => '', + :detailed => '', + :backends => '', + :allowed_source_ranges => '', + :ignore_proxied_requests => '', + :disable_by_file_path => '', + :disable_by_file_paths => '', ) end end @@ -25,12 +26,13 @@ describe 'mistral::healthcheck' do context 'with specific parameters' do let :params do { - :enabled => true, - :detailed => true, - :backends => ['disable_by_file'], - :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], - :disable_by_file_path => '/etc/mistral/healthcheck/disabled', - :disable_by_file_paths => ['8989:/etc/mistral/healthcheck/disabled'], + :enabled => true, + :detailed => true, + :backends => ['disable_by_file'], + :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], + :ignore_proxied_requests => false, + :disable_by_file_path => '/etc/mistral/healthcheck/disabled', + :disable_by_file_paths => ['8989:/etc/mistral/healthcheck/disabled'], } end @@ -38,11 +40,12 @@ describe 'mistral::healthcheck' do is_expected.to contain_mistral_config('healthcheck/enabled').with_value(true) is_expected.to contain_oslo__healthcheck('mistral_config').with( - :detailed => true, - :backends => ['disable_by_file'], - :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], - :disable_by_file_path => '/etc/mistral/healthcheck/disabled', - :disable_by_file_paths => ['8989:/etc/mistral/healthcheck/disabled'], + :detailed => true, + :backends => ['disable_by_file'], + :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], + :ignore_proxied_requests => false, + :disable_by_file_path => '/etc/mistral/healthcheck/disabled', + :disable_by_file_paths => ['8989:/etc/mistral/healthcheck/disabled'], ) end end