Merge "Deprecate support for removed api_vN_enabled options"

This commit is contained in:
Zuul
2025-10-13 15:19:03 +00:00
committed by Gerrit Code Review
3 changed files with 35 additions and 18 deletions

View File

@@ -39,14 +39,6 @@
# (optional) The handler that the API communicates with
# Defaults to $facts['os_service_default']
#
# [*api_v1_enabled*]
# (optional) Boolean if V1 API should be enabled.
# Defaults to $facts['os_service_default']
#
# [*api_v2_enabled*]
# (optional) Boolean if V2 API should be enabled.
# Defaults to $facts['os_service_default']
#
# [*allow_tls_terminated_listeners*]
# (optional) Boolean if we allow creation of TLS terminated listeners.
# Defaults to $facts['os_service_default']
@@ -119,6 +111,16 @@
# (optional) Allow PROMETHEUS type listeners.
# Defaults to $facts['os_service_default']
#
# DEPRECATED PARAMETERS
#
# [*api_v1_enabled*]
# (optional) Boolean if V1 API should be enabled.
# Defaults to undef
#
# [*api_v2_enabled*]
# (optional) Boolean if V2 API should be enabled.
# Defaults to undef
#
class octavia::api (
Boolean $enabled = true,
Boolean $manage_service = true,
@@ -128,8 +130,6 @@ class octavia::api (
Stdlib::Ensure::Package $package_ensure = 'present',
Enum['keystone', 'noauth'] $auth_strategy = 'keystone',
$api_handler = $facts['os_service_default'],
$api_v1_enabled = $facts['os_service_default'],
$api_v2_enabled = $facts['os_service_default'],
$allow_tls_terminated_listeners = $facts['os_service_default'],
Boolean $sync_db = false,
$enable_proxy_headers_parsing = $facts['os_service_default'],
@@ -147,6 +147,9 @@ class octavia::api (
$minimum_tls_version = $facts['os_service_default'],
$allow_ping_health_monitors = $facts['os_service_default'],
$allow_prometheus_listeners = $facts['os_service_default'],
# DEPRECATED PARAMETERS
$api_v1_enabled = undef,
$api_v2_enabled = undef,
) inherits octavia::params {
include octavia::deps
include octavia::policy
@@ -156,6 +159,14 @@ class octavia::api (
include octavia::keystone::authtoken
}
[
'api_v1_enabled', 'api_v2_enabled',
].each |String $opt| {
if getvar($opt) != undef {
warning("The ${opt} parameter is deprecated and has no effect.")
}
}
package { 'octavia-api':
ensure => $package_ensure,
name => $octavia::params::api_package_name,
@@ -211,8 +222,6 @@ class octavia::api (
'api_settings/bind_port': value => $port;
'api_settings/auth_strategy': value => $auth_strategy;
'api_settings/api_handler': value => $api_handler;
'api_settings/api_v1_enabled': value => $api_v1_enabled;
'api_settings/api_v2_enabled': value => $api_v2_enabled;
'api_settings/allow_tls_terminated_listeners': value => $allow_tls_terminated_listeners;
'api_settings/default_provider_driver': value => $default_provider_driver;
'api_settings/enabled_provider_drivers': value => $enabled_provider_drivers_real;
@@ -229,6 +238,12 @@ class octavia::api (
'api_settings/allow_prometheus_listeners': value => $allow_prometheus_listeners;
}
# TODO(tkajinam): Remove this after 2026.1 release
octavia_config {
'api_settings/api_v1_enabled': ensure => absent;
'api_settings/api_v2_enabled': ensure => absent;
}
oslo::middleware { 'octavia_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
max_request_body_size => $max_request_body_size,

View File

@@ -0,0 +1,8 @@
---
deprecations:
- |
The following parameters of the ``octavia::api`` class have been deprecated
and have no effect now.
- ``api_v1_enabled``
- ``api_v2_enabled``

View File

@@ -8,8 +8,6 @@ describe 'octavia::api' do
:port => '9876',
:host => '0.0.0.0',
:api_handler => 'queue_producer',
:api_v1_enabled => true,
:api_v2_enabled => true,
:allow_tls_terminated_listeners => false,
:default_provider_driver => 'ovn',
:enabled_provider_drivers => 'amphora:Octavia Amphora driver,ovn:Octavia OVN driver',
@@ -53,8 +51,6 @@ describe 'octavia::api' do
is_expected.to contain_octavia_config('api_settings/bind_port').with_value( '9876' )
is_expected.to contain_octavia_config('api_settings/auth_strategy').with_value( 'keystone' )
is_expected.to contain_octavia_config('api_settings/api_handler').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/api_v1_enabled').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/api_v2_enabled').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/allow_tls_terminated_listeners').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/default_provider_driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/enabled_provider_drivers').with_value('<SERVICE DEFAULT>')
@@ -83,8 +79,6 @@ describe 'octavia::api' do
is_expected.to contain_octavia_config('api_settings/bind_host').with_value( params[:host] )
is_expected.to contain_octavia_config('api_settings/bind_port').with_value( params[:port] )
is_expected.to contain_octavia_config('api_settings/api_handler').with_value( params[:api_handler] )
is_expected.to contain_octavia_config('api_settings/api_v1_enabled').with_value( params[:api_v1_enabled] )
is_expected.to contain_octavia_config('api_settings/api_v2_enabled').with_value( params[:api_v2_enabled] )
is_expected.to contain_octavia_config('api_settings/allow_tls_terminated_listeners').with_value( params[:allow_tls_terminated_listeners] )
is_expected.to contain_octavia_config('api_settings/default_provider_driver').with_value( params[:default_provider_driver] )
is_expected.to contain_octavia_config('api_settings/enabled_provider_drivers').with_value( params[:enabled_provider_drivers] )