Browse Source

Deprecate spare_amphorae_pool_size

In octavia::housekeeping class the spare pool size variable
is misspelled and has no effect.  A new parameter has been
added with the correct spelling. The configuration option
in octavia conf is now correctly configured.

Change-Id: I1d72117dfa13c546e3b27ba67fb9e735d0f3b2f3
(cherry picked from commit 6a8720da4f)
changes/51/677751/1
Matthew J. Black 2 months ago
parent
commit
e59bc8bef9

+ 18
- 4
manifests/housekeeping.pp View File

@@ -18,8 +18,8 @@
18 18
 #   (optional) spare check interval in seconds.
19 19
 #   Defaults to $::os_service_default
20 20
 #
21
-# [*spare_amphorae_pool_size*]
22
-#   (optional) Number of spare amphorae.
21
+# [*spare_amphora_pool_size*]
22
+#   (optional) Number of spare amphora.
23 23
 #   Defaults to $::os_service_default
24 24
 #
25 25
 # [*cleanup_interval*]
@@ -46,22 +46,36 @@
46 46
 #   (optional) Number of threads performing amphora certificate rotation.
47 47
 #   Defaults to $::os_service_default
48 48
 #
49
+# DEPRECATED PARAMETERS
50
+#
51
+# [*spare_amphorae_pool_size*]
52
+#   (optional) Number of spare amphorae.
53
+#   Defaults to $::os_service_default
54
+#
49 55
 class octavia::housekeeping (
50 56
   $manage_service            = true,
51 57
   $enabled                   = true,
52 58
   $package_ensure            = 'present',
53 59
   $spare_check_interval      = $::os_service_default,
54
-  $spare_amphorae_pool_size  = $::os_service_default,
60
+  $spare_amphora_pool_size   = $::os_service_default,
55 61
   $cleanup_interval          = $::os_service_default,
56 62
   $amphora_expiry_age        = $::os_service_default,
57 63
   $load_balancer_expiry_age  = $::os_service_default,
58 64
   $cert_interval             = $::os_service_default,
59 65
   $cert_expiry_buffer        = $::os_service_default,
60 66
   $cert_rotate_threads       = $::os_service_default,
67
+  # DEPRECATED PARAMETERS
68
+  $spare_amphorae_pool_size  = undef
61 69
 ) inherits octavia::params {
62 70
 
63 71
   include ::octavia::deps
64 72
 
73
+  if $spare_amphorae_pool_size {
74
+    warning('spare_amphorae_pool_size is deprecated and will be removed in the future. Please use spare_amphora_pool_size.')
75
+  }
76
+
77
+  $spare_amphora_pool_size_real = pick($spare_amphorae_pool_size, $spare_amphora_pool_size)
78
+
65 79
   package { 'octavia-housekeeping':
66 80
     ensure => $package_ensure,
67 81
     name   => $::octavia::params::housekeeping_package_name,
@@ -87,7 +101,7 @@ class octavia::housekeeping (
87 101
 
88 102
   octavia_config {
89 103
     'house_keeping/spare_check_interval'       : value => $spare_check_interval;
90
-    'house_keeping/spare_amphorae_pool_size'   : value => $spare_amphorae_pool_size;
104
+    'house_keeping/spare_amphora_pool_size'    : value => $spare_amphora_pool_size_real;
91 105
     'house_keeping/cleanup_interval'           : value => $cleanup_interval;
92 106
     'house_keeping/amphora_expiry_age'         : value => $amphora_expiry_age;
93 107
     'house_keeping/load_balancer_expiry_age'   : value => $load_balancer_expiry_age;

+ 4
- 0
releasenotes/notes/deprecate_spare_amphorae_pool_size_name-f7b3324f8fcf9670.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+deprecations:
3
+  - octavia::housekeeping::spare_amphorae_pool_size is deprecated and will be removed in the future release.
4
+    Please use octavia::housekeeping::spare_amphora_pool_size instead.

+ 3
- 3
spec/classes/octavia_housekeeping_spec.rb View File

@@ -20,7 +20,7 @@ describe 'octavia::housekeeping' do
20 20
     end
21 21
 
22 22
     context 'check parameters with defaults' do
23
-      ['spare_check_interval', 'spare_amphorae_pool_size', 'cleanup_interval',
23
+      ['spare_check_interval', 'spare_amphora_pool_size', 'cleanup_interval',
24 24
        'amphora_expiry_age', 'load_balancer_expiry_age', 'cert_interval',
25 25
        'cert_expiry_buffer', 'cert_rotate_threads'].each do |param_with_default|
26 26
          it { is_expected.to contain_octavia_config("house_keeping/#{param_with_default}").with_value('<SERVICE DEFAULT>') }
@@ -29,7 +29,7 @@ describe 'octavia::housekeeping' do
29 29
 
30 30
     let :default_parameters do
31 31
       { :spare_check_interval      => 60,
32
-        :spare_amphorae_pool_size  => 20,
32
+        :spare_amphora_pool_size   => 20,
33 33
         :cleanup_interval          => 26,
34 34
         :amphora_expiry_age        => 200000,
35 35
         :load_balancer_expiry_age  => 23131,
@@ -43,7 +43,7 @@ describe 'octavia::housekeeping' do
43 43
       before :each do
44 44
         params.merge!(default_parameters)
45 45
       end
46
-      ['spare_check_interval', 'spare_amphorae_pool_size', 'cleanup_interval',
46
+      ['spare_check_interval', 'spare_amphora_pool_size', 'cleanup_interval',
47 47
        'amphora_expiry_age', 'load_balancer_expiry_age', 'cert_interval',
48 48
        'cert_expiry_buffer', 'cert_rotate_threads'].each do |param_with_default|
49 49
          it { is_expected.to contain_octavia_config("house_keeping/#{param_with_default}").with_value(default_parameters[param_with_default.to_sym]) }

Loading…
Cancel
Save