From c18c67fef8a5136a24e6ae931b072517fc34f1ab Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 11 Mar 2025 19:56:35 +0900 Subject: [PATCH] Deprecate support for tenant_name_discovery ... because the option was deprecated in favor of the new identity_name_discovery option. Depends-on: https://review.opendev.org/943892 Change-Id: I8121285d39fab726ff548ca84767620fb03ffbd6 --- manifests/agent/polling.pp | 27 ++++++++++++++++--- ...enant_name_discovery-ddd44c761634792f.yaml | 5 ++++ spec/classes/ceilometer_agent_polling_spec.rb | 6 ++--- 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/deprecate-tenant_name_discovery-ddd44c761634792f.yaml diff --git a/manifests/agent/polling.pp b/manifests/agent/polling.pp index 6e142e34..93eff275 100644 --- a/manifests/agent/polling.pp +++ b/manifests/agent/polling.pp @@ -82,7 +82,7 @@ # (Optional) Batch size of samples to send to notification agent. # Defaults to $facts['os_service_default']. # -# [*tenant_name_discovery*] +# [*identity_name_discovery*] # (Optional) Identify user and project names from polled metrics. # Defaults to $facts['os_service_default']. # @@ -109,6 +109,12 @@ # (Optional) List of directories with YAML files used to create pollsters. # Defaults to $facts['os_service_default']. # +# DEPRECATED PARAMETERS +# +# [*tenant_name_discovery*] +# (Optional) Identify user and project names from polled metrics. +# Defaults to undef +# class ceilometer::agent::polling ( Boolean $manage_service = true, Boolean $enabled = true, @@ -127,17 +133,27 @@ class ceilometer::agent::polling ( Optional[Hash] $polling_config = undef, $cfg_file = $facts['os_service_default'], $batch_size = $facts['os_service_default'], - $tenant_name_discovery = $facts['os_service_default'], + $identity_name_discovery = $facts['os_service_default'], $ignore_disabled_projects = $facts['os_service_default'], $enable_notifications = $facts['os_service_default'], $enable_prometheus_exporter = $facts['os_service_default'], $prometheus_listen_addresses = $facts['os_service_default'], $pollsters_definitions_dirs = $facts['os_service_default'], + # DEPRECATED PARAMETERS + $tenant_name_discovery = undef, ) inherits ceilometer { include ceilometer::deps include ceilometer::params + if $tenant_name_discovery != undef { + warning("The tenant_name_discovery parameter is deprecated. \ +Use the identity_name_discovery parameter instead.") + $identity_name_discovery_real = $tenant_name_discovery + } else { + $identity_name_discovery_real = $identity_name_discovery + } + if $central_namespace { $central_namespace_name = 'central' } else { @@ -243,7 +259,7 @@ class ceilometer::agent::polling ( ceilometer_config { 'polling/batch_size': value => $batch_size; - 'polling/tenant_name_discovery': value => $tenant_name_discovery; + 'polling/identity_name_discovery': value => $identity_name_discovery_real; 'polling/ignore_disabled_projects': value => $ignore_disabled_projects; 'polling/pollsters_definitions_dirs': value => join(any2array($pollsters_definitions_dirs), ','); 'polling/enable_notifications': value => $enable_notifications; @@ -251,6 +267,11 @@ class ceilometer::agent::polling ( 'polling/prometheus_listen_addresses': value => join(any2array($prometheus_listen_addresses), ','); } + # TODO(tkajinam): Remove this after 2025.1 release + ceilometer_config { + 'polling/tenant_name_discovery': ensure => absent; + } + if $manage_service { if $enabled { $service_ensure = 'running' diff --git a/releasenotes/notes/deprecate-tenant_name_discovery-ddd44c761634792f.yaml b/releasenotes/notes/deprecate-tenant_name_discovery-ddd44c761634792f.yaml new file mode 100644 index 00000000..1c9e3f0c --- /dev/null +++ b/releasenotes/notes/deprecate-tenant_name_discovery-ddd44c761634792f.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``ceilometer::agent::polling::tenant_name_discovery`` parameter has + been deprecated in favor of the new ``identity_name_discovery`` parameter. diff --git a/spec/classes/ceilometer_agent_polling_spec.rb b/spec/classes/ceilometer_agent_polling_spec.rb index 813c0b7c..c1b58fc0 100644 --- a/spec/classes/ceilometer_agent_polling_spec.rb +++ b/spec/classes/ceilometer_agent_polling_spec.rb @@ -72,7 +72,7 @@ describe 'ceilometer::agent::polling' do it { should contain_ceilometer_config('polling/batch_size').with_value('') } it { should_not contain_file('polling') } - it { should contain_ceilometer_config('polling/tenant_name_discovery').with_value('') } + it { should contain_ceilometer_config('polling/identity_name_discovery').with_value('') } it { should contain_ceilometer_config('polling/ignore_disabled_projects').with_value('') } it { should contain_ceilometer_config('polling/enable_notifications').with_value('') } it { should contain_ceilometer_config('polling/enable_prometheus_exporter').with_value('') } @@ -110,7 +110,7 @@ describe 'ceilometer::agent::polling' do context 'when common parameters are set' do before do params.merge!( - :tenant_name_discovery => true, + :identity_name_discovery => true, :ignore_disabled_projects => false, :enable_notifications => true, :enable_prometheus_exporter => false, @@ -120,7 +120,7 @@ describe 'ceilometer::agent::polling' do end it { - should contain_ceilometer_config('polling/tenant_name_discovery').with_value(true) + should contain_ceilometer_config('polling/identity_name_discovery').with_value(true) should contain_ceilometer_config('polling/ignore_disabled_projects').with_value(false) should contain_ceilometer_config('polling/enable_notifications').with_value(true) should contain_ceilometer_config('polling/enable_prometheus_exporter').with_value(false)