From 2db61dcc98a1ec08fe07489c6091882a9513a661 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 3 Feb 2024 16:43:21 +0900 Subject: [PATCH] quota: Stop overriding defaults ... and use the service defaults instead. Current values are based on the old default values in trove but these were changed in trove some time ago[1]. [1] 9e3860d54cc0fea59e80b1705c02c78cca8e1953 Change-Id: If6ba170457ca11cbd0531ff8ea1e87346b43dcc2 --- manifests/quota.pp | 20 +++++------ ...fault-for-quota-opts-d06793e6832314d3.yaml | 5 +++ spec/classes/trove_quota_spec.rb | 35 +++++++------------ 3 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 releasenotes/notes/use-service-default-for-quota-opts-d06793e6832314d3.yaml diff --git a/manifests/quota.pp b/manifests/quota.pp index f30b9221..531e1ec6 100644 --- a/manifests/quota.pp +++ b/manifests/quota.pp @@ -6,15 +6,15 @@ # # [*max_instances_per_tenant*] # (optional) Default maximum number of instances per tenant. -# Defaults to 5. +# Defaults to $facts['os_service_default']. # # [*max_ram_per_tenant*] # (optional) Default maximum amount of RAM (in MB) per tenant. -# Defaults to -1. +# Defaults to $facts['os_service_default']. # # [*max_accepted_volume_size*] # (optional) Default maximum volume size (in GB) for an instance. -# Defaults to 5. +# Defaults to $facts['os_service_default']. # # [*max_volumes_per_tenant*] # (optional) Default maximum volume capacity (in GB) spanning across @@ -23,19 +23,19 @@ # # [*max_backups_per_tenant*] # (optional) Default maximum number of backups created by a tenant. -# Defaults to 50. +# Defaults to $facts['os_service_default']. # # [*quota_driver*] # (optional) Default driver to use for quota checks. # Defaults to 'trove.quota.quota.DbQuotaDriver'. # class trove::quota ( - $max_instances_per_tenant = 5, - $max_ram_per_tenant = -1, - $max_accepted_volume_size = 5, - $max_volumes_per_tenant = 20, - $max_backups_per_tenant = 50, - $quota_driver = 'trove.quota.quota.DbQuotaDriver', + $max_instances_per_tenant = $facts['os_service_default'], + $max_ram_per_tenant = $facts['os_service_default'], + $max_accepted_volume_size = $facts['os_service_default'], + $max_volumes_per_tenant = $facts['os_service_default'], + $max_backups_per_tenant = $facts['os_service_default'], + $quota_driver = $facts['os_service_default'], ) { include trove::deps diff --git a/releasenotes/notes/use-service-default-for-quota-opts-d06793e6832314d3.yaml b/releasenotes/notes/use-service-default-for-quota-opts-d06793e6832314d3.yaml new file mode 100644 index 00000000..d56afafa --- /dev/null +++ b/releasenotes/notes/use-service-default-for-quota-opts-d06793e6832314d3.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + Default values of the ``trove::quota`` class parameters have been updated + and now the service default values are used by default. diff --git a/spec/classes/trove_quota_spec.rb b/spec/classes/trove_quota_spec.rb index 1cf5329b..9c372698 100644 --- a/spec/classes/trove_quota_spec.rb +++ b/spec/classes/trove_quota_spec.rb @@ -5,18 +5,12 @@ describe 'trove::quota' do shared_examples_for 'trove::quota' do context 'with default parameters' do it 'contains default values' do - is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with( - :value => 5) - is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with( - :value => -1) - is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with( - :value => 5) - is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with( - :value => 20) - is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with( - :value => 50) - is_expected.to contain_trove_config('DEFAULT/quota_driver').with( - :value => 'trove.quota.quota.DbQuotaDriver') + is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with_value('') + is_expected.to contain_trove_config('DEFAULT/quota_driver').with_value('') end end @@ -27,19 +21,16 @@ describe 'trove::quota' do :max_accepted_volume_size => 10, :max_volumes_per_tenant => 100, :max_backups_per_tenant => 100, + :quota_driver => 'trove.quota.quota.DbQuotaDriver', } end it 'contains overrided values' do - is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with( - :value => 10) - is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with( - :value => 10) - is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with( - :value => 10) - is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with( - :value => 100) - is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with( - :value => 100) + is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with_value(10) + is_expected.to contain_trove_config('DEFAULT/max_ram_per_tenant').with_value(10) + is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with_value(10) + is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with_value(100) + is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with_value(100) + is_expected.to contain_trove_config('DEFAULT/quota_driver').with_value('trove.quota.quota.DbQuotaDriver') end end end