From 1d2aa66abe65b200eec68678881aff0a54e23b08 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 13 Sep 2024 11:53:40 +0900 Subject: [PATCH] Add support for [DEFAULT] hidden_stack_tags Change-Id: I753751dab926f84c4596e08ee98e7bc4f6141890 --- manifests/engine.pp | 6 ++++++ .../engine-hidden_stack_tags-5e25b4ecf56893ce.yaml | 4 ++++ spec/classes/heat_engine_spec.rb | 14 +++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/engine-hidden_stack_tags-5e25b4ecf56893ce.yaml diff --git a/manifests/engine.pp b/manifests/engine.pp index 65665cc5..b3f71d83 100644 --- a/manifests/engine.pp +++ b/manifests/engine.pp @@ -187,6 +187,10 @@ # by user-controlled servers to make calls back to Heat. # Defaults to $facts['os_service_default'] # +# [*hidden_stack_tags*] +# (Optional) Stacks containing these tag names will be hidden. +# Defaults to $facts['os_service_default'] +# # DEPRECATED PARAMETERS # # [*deferred_auth_method*] @@ -231,6 +235,7 @@ class heat::engine ( $max_nested_stack_depth = $facts['os_service_default'], $plugin_dirs = $facts['os_service_default'], $server_keystone_endpoint_type = $facts['os_service_default'], + $hidden_stack_tags = $facts['os_service_default'], # DEPRECATED PARAMETERS $deferred_auth_method = undef, ) { @@ -305,6 +310,7 @@ class heat::engine ( 'DEFAULT/max_nested_stack_depth': value => $max_nested_stack_depth; 'DEFAULT/plugin_dirs': value => $plugin_dirs_real; 'DEFAULT/server_keystone_endpoint_type': value => $server_keystone_endpoint_type; + 'DEFAULT/hidden_stack_tags': value => join(any2array($hidden_stack_tags), ','); } if $deferred_auth_method != undef { diff --git a/releasenotes/notes/engine-hidden_stack_tags-5e25b4ecf56893ce.yaml b/releasenotes/notes/engine-hidden_stack_tags-5e25b4ecf56893ce.yaml new file mode 100644 index 00000000..357d5ad6 --- /dev/null +++ b/releasenotes/notes/engine-hidden_stack_tags-5e25b4ecf56893ce.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``heat::engine::hidden_stack_tags`` parameter has been added. diff --git a/spec/classes/heat_engine_spec.rb b/spec/classes/heat_engine_spec.rb index 8ae9d2a3..757b0075 100644 --- a/spec/classes/heat_engine_spec.rb +++ b/spec/classes/heat_engine_spec.rb @@ -29,6 +29,7 @@ describe 'heat::engine' do :max_nested_stack_depth => '', :plugin_dirs => '', :server_keystone_endpoint_type => '', + :hidden_stack_tags => '', :deferred_auth_method => '', } end @@ -68,6 +69,7 @@ describe 'heat::engine' do :template_dir => '/etc/heat/templates', :max_nested_stack_depth => 3, :server_keystone_endpoint_type => 'public', + :hidden_stack_tags => 'hidden', :deferred_auth_method => 'trusts', } ].each do |new_params| @@ -129,6 +131,7 @@ describe 'heat::engine' do it { is_expected.to contain_heat_config('DEFAULT/max_nested_stack_depth').with_value( expected_params[:max_nested_stack_depth] ) } it { is_expected.to contain_heat_config('DEFAULT/plugin_dirs').with_value( expected_params[:plugin_dirs] ) } it { is_expected.to contain_heat_config('DEFAULT/server_keystone_endpoint_type').with_value( expected_params[:server_keystone_endpoint_type] ) } + it { is_expected.to contain_heat_config('DEFAULT/hidden_stack_tags').with_value( expected_params[:hidden_stack_tags] ) } it { is_expected.to contain_heat_config('DEFAULT/deferred_auth_method').with_value( expected_params[:deferred_auth_method] ) } end @@ -164,7 +167,16 @@ describe 'heat::engine' do params.merge!({ :plugin_dirs => ['/usr/lib/heat', '/usr/local/lib/heat'] }) end - it { is_expected.to contain_heat_config('DEFAULT/plugin_dirs').with_value(['/usr/lib/heat,/usr/local/lib/heat']) } + it { is_expected.to contain_heat_config('DEFAULT/plugin_dirs').with_value('/usr/lib/heat,/usr/local/lib/heat') } + end + + context 'with hidden_stack_tags list' do + before do + params.merge!({ + :hidden_stack_tags => ['tag1', 'tag2'], + }) + end + it { is_expected.to contain_heat_config('DEFAULT/hidden_stack_tags').with_value('tag1,tag2') } end end