From 0e1c3746be6b3956044bee2159211b6d6acd6d43 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 3 Nov 2024 09:25:24 +0900 Subject: [PATCH] Add support for [cache] backend_expiration_time Depends-on: https://review.opendev.org/933978 Change-Id: I67f441af06d2702fc9ae01e58b9e12d4aaf841ea --- manifests/cache.pp | 7 +++++++ .../cache-backend-expiration-time-3bf5147ae4a4a192.yaml | 5 +++++ spec/classes/watcher_cache_spec.rb | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/cache-backend-expiration-time-3bf5147ae4a4a192.yaml diff --git a/manifests/cache.pp b/manifests/cache.pp index bcfe7b1..effc56c 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -18,6 +18,11 @@ # (integer value) # Defaults to $facts['os_service_default'] # +# [*backend_expiration_time*] +# (Optional) Expiration time in cache backend to purge expired records +# automatically. +# Defaults to $facts['os_service_default'] +# # [*backend*] # (Optional) Dogpile.cache backend module. It is recommended that # Memcache with pooling (oslo_cache.memcache_pool) or Redis @@ -215,6 +220,7 @@ class watcher::cache ( $config_prefix = $facts['os_service_default'], $expiration_time = $facts['os_service_default'], + $backend_expiration_time = $facts['os_service_default'], $backend = $facts['os_service_default'], $backend_argument = $facts['os_service_default'], $proxies = $facts['os_service_default'], @@ -259,6 +265,7 @@ class watcher::cache ( oslo::cache { 'watcher_config': config_prefix => $config_prefix, expiration_time => $expiration_time, + backend_expiration_time => $backend_expiration_time, backend => $backend, backend_argument => $backend_argument, proxies => $proxies, diff --git a/releasenotes/notes/cache-backend-expiration-time-3bf5147ae4a4a192.yaml b/releasenotes/notes/cache-backend-expiration-time-3bf5147ae4a4a192.yaml new file mode 100644 index 0000000..9928888 --- /dev/null +++ b/releasenotes/notes/cache-backend-expiration-time-3bf5147ae4a4a192.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``watcher::cache::backend_expiration_time`` parameter has been + added. diff --git a/spec/classes/watcher_cache_spec.rb b/spec/classes/watcher_cache_spec.rb index 87a8700..7acba7a 100644 --- a/spec/classes/watcher_cache_spec.rb +++ b/spec/classes/watcher_cache_spec.rb @@ -13,6 +13,7 @@ describe 'watcher::cache' do is_expected.to contain_oslo__cache('watcher_config').with( :config_prefix => '', :expiration_time => '', + :backend_expiration_time => '', :backend => '', :backend_argument => '', :proxies => '', @@ -58,6 +59,7 @@ describe 'watcher::cache' do { :config_prefix => 'prefix', :expiration_time => 3600, + :backend_expiration_time => 7200, :backend => 'oslo_cache.memcache_pool', :proxies => ['proxy01:8888', 'proxy02:8888'], :enabled => true, @@ -97,6 +99,7 @@ describe 'watcher::cache' do is_expected.to contain_oslo__cache('watcher_config').with( :config_prefix => 'prefix', :expiration_time => 3600, + :backend_expiration_time => 7200, :backend => 'oslo_cache.memcache_pool', :backend_argument => '', :proxies => ['proxy01:8888', 'proxy02:8888'],