Add support for new limit options

This introduces support for the new limit options which were added to
heat during 2024.1 cycle.

Depends-on: https://review.opendev.org/c/openstack/heat/+/906272
Change-Id: I622328a61ea24682dbe65dc4f4b3a90df5c7208f
This commit is contained in:
Takashi Kajinami 2024-03-16 12:05:07 +09:00
parent 2334842ab1
commit bd2debe260
3 changed files with 40 additions and 2 deletions

View File

@ -142,6 +142,21 @@
# (Optional) Maximum resources allowed per top-level stack.
# Defaults to $facts['os_service_default']
#
# [*max_software_configs_per_tenant*]
# (Optional) Maximum number of software configs any one tenant may have
# active at one time.
# Defaults to $facts['os_service_default'].
#
# [*max_software_deployments_per_tenant*]
# (Optional) Maximum number of software deployments any one tenant may have
# active at one time.
# Defaults to $facts['os_service_default'].
#
# [*max_snapshots_per_stack*]
# (Optional) Maximum number of snapshot any one stack may have active at one
# time.
# Defaults to $facts['os_service_default'].
#
# [*num_engine_workers*]
# (Optional) The number of workers to spawn.
# Defaults to $facts['os_workers_heat_engine']
@ -196,6 +211,9 @@ class heat::engine (
$instance_connection_https_validate_certificates = $facts['os_service_default'],
$max_stacks_per_tenant = $facts['os_service_default'],
$max_resources_per_stack = $facts['os_service_default'],
$max_software_configs_per_tenant = $facts['os_service_default'],
$max_software_deployments_per_tenant = $facts['os_service_default'],
$max_snapshots_per_stack = $facts['os_service_default'],
$action_retry_limit = $facts['os_service_default'],
$client_retry_limit = $facts['os_service_default'],
$max_server_name_length = $facts['os_service_default'],
@ -274,6 +292,9 @@ class heat::engine (
'DEFAULT/trusts_delegated_roles': value => join(any2array($trusts_delegated_roles), ',');
'DEFAULT/max_stacks_per_tenant': value => $max_stacks_per_tenant;
'DEFAULT/max_resources_per_stack': value => $max_resources_per_stack;
'DEFAULT/max_software_configs_per_tenant': value => $max_software_configs_per_tenant;
'DEFAULT/max_software_deployments_per_tenant': value => $max_software_deployments_per_tenant;
'DEFAULT/max_snapshots_per_stack': value => $max_snapshots_per_stack;
'DEFAULT/action_retry_limit': value => $action_retry_limit;
'DEFAULT/client_retry_limit': value => $client_retry_limit;
'DEFAULT/max_server_name_length': value => $max_server_name_length;

View File

@ -0,0 +1,8 @@
---
features:
- |
The following parameters have been added to the ``heat::engine`` class.
- ``max_software_configs_per_tenant``
- ``max_software_deployments_per_tenant``
- ``max_snapshots_per_stack``

View File

@ -111,6 +111,9 @@ describe 'heat::engine' do
it { is_expected.to contain_heat_config('DEFAULT/instance_connection_https_validate_certificates').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_heat_config('DEFAULT/max_stacks_per_tenant').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_heat_config('DEFAULT/max_resources_per_stack').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_heat_config('DEFAULT/max_software_configs_per_tenant').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_heat_config('DEFAULT/max_software_deployments_per_tenant').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_heat_config('DEFAULT/max_snapshots_per_stack').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_heat_config('DEFAULT/action_retry_limit').with_value( expected_params[:action_retry_limit] ) }
it { is_expected.to contain_heat_config('DEFAULT/client_retry_limit').with_value( expected_params[:client_retry_limit] ) }
it { is_expected.to contain_heat_config('DEFAULT/max_server_name_length').with_value( expected_params[:max_server_name_length] ) }
@ -133,12 +136,18 @@ describe 'heat::engine' do
context 'with max limits are defined' do
before do
params.merge!({
:max_stacks_per_tenant => 512,
:max_resources_per_stack => 1000,
:max_stacks_per_tenant => 512,
:max_resources_per_stack => 1000,
:max_software_configs_per_tenant => 4096,
:max_software_deployments_per_tenant => 4096,
:max_snapshots_per_stack => 32,
})
end
it { is_expected.to contain_heat_config('DEFAULT/max_stacks_per_tenant').with_value(512) }
it { is_expected.to contain_heat_config('DEFAULT/max_resources_per_stack').with_value(1000) }
it { is_expected.to contain_heat_config('DEFAULT/max_software_configs_per_tenant').with_value(4096) }
it { is_expected.to contain_heat_config('DEFAULT/max_software_deployments_per_tenant').with_value(4096) }
it { is_expected.to contain_heat_config('DEFAULT/max_snapshots_per_stack').with_value(32) }
end
context 'with disabled service managing' do