Fix octavia::controller redeclaration

It's impossible to use this new class because you
cannot use any services combined with and specify
the parameters in octavia::controler since you get
redeclaration issues.

The class should only be included from octavia::worker
if it doesn't exist to support the old use case.

If you want to use this class it's required that you
define octavia::controller *before* octavia::worker
otherwise you'll end up with another redeclaration
issue since we include the controller unless its
defined before.

Depends-On: https://review.openstack.org/#/c/618915/
Change-Id: If5b4014d2129879199798d440ae604c03b01ab3a
This commit is contained in:
Tobias Urdin 2018-11-20 15:55:00 +01:00
parent 6ffe2b4de2
commit 0ea4e10dd3
5 changed files with 12 additions and 6 deletions

View File

@ -72,7 +72,6 @@ class octavia::api (
include ::octavia::deps
include ::octavia::policy
include ::octavia::controller
if $auth_strategy == 'keystone' {
include ::octavia::keystone::authtoken

View File

@ -40,7 +40,6 @@ class octavia::health_manager (
) inherits octavia::params {
include ::octavia::deps
include ::octavia::controller
validate_string($heartbeat_key)

View File

@ -61,7 +61,6 @@ class octavia::housekeeping (
) inherits octavia::params {
include ::octavia::deps
include ::octavia::controller
package { 'octavia-housekeeping':
ensure => $package_ensure,

View File

@ -134,14 +134,18 @@ class octavia::worker (
) inherits octavia::params {
include ::octavia::deps
include ::octavia::controller
if !defined(Class['octavia::controller']) {
include ::octavia::controller
}
if ($amp_flavor_id or $amp_image_tag or $amp_secgroup_list or $amp_boot_network_list or $loadbalancer_topology or $amphora_driver or
$compute_driver or $network_driver or $amp_ssh_key_name or $enable_ssh_access or $timeout_client_data or $timeout_member_connect or
$timeout_member_data or $timeout_tcp_inspect ) {
warning('The amp_flavor_id, amp_image_tag, amp_secgroup_list, amp_boot_network_list, loadbalancer_topology, amphora_driver,
compute_driver, network_driver, amp_ssh_key_name, enable_ssh_access, timeout_member_connect, timeout_member_data and
timeout_tcp_inspect parameters are deprecated and have been moved to octavia::controller class. Please set them there.')
timeout_tcp_inspect parameters are deprecated and have been moved to octavia::controller class. Please set them there, you must
set octavia::controller class before octavia::worker!')
}
validate_hash($nova_flavor_config)

View File

@ -2,7 +2,8 @@
deprecations:
- |
The following octavia::worker parameters are deprecated and have been
moved to octavia::controller class.
moved to octavia::controller class. When you start using octavia::controller
make sure it's defined before octavia::worker.
* amp_flavor_id
* amp_image_tag
@ -27,3 +28,7 @@ fixes:
allowed_address_pairs_driver. Another example is the database that was only
being set for the API service. Such configuration misalignment and
omissions lead to operate Octavia services and its resources.
upgrade:
- |
If you want to use the new octavia::controller class you must define it
before the octavia::worker class.