Fix disabled UDP pools

Disabling a UDP pool didn't disable it correctly, requests were still
forwarded to the members.
Now, when disabling a UDP pool, the members are removed from the
configuration file.

Story 2010011
Task 45164

Change-Id: I7d92b011455d95a2df7782984b8f4648d4b00941
This commit is contained in:
Gregory Thiemonge 2022-04-26 09:23:07 +02:00
parent 384b83d88b
commit f4b32ac313
3 changed files with 9 additions and 10 deletions

View File

@ -132,9 +132,11 @@ virtual_server {{ lb_vip_address }} {{ listener.protocol_port }} {
{% if default_pool.health_monitor and default_pool.health_monitor.enabled %}
# Configuration for HealthMonitor {{ default_pool.health_monitor.id }}
{% endif %}
{% for member in default_pool.members %}
{% if default_pool.enabled %}
{% for member in default_pool.members %}
{{- realserver_macro(constants, lib_consts, default_pool, member, listener) }}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
}
{% endif %}

View File

@ -251,14 +251,6 @@ class TestLvsCfg(base.TestCase):
" lb_kind NAT\n"
" protocol UDP\n\n\n"
" # Pool sample_pool_id_1 is disabled\n"
" # Configuration for Member sample_member_id_1\n"
" real_server 10.0.0.99 82 {\n"
" weight 13\n\n"
" }\n\n"
" # Configuration for Member sample_member_id_2\n"
" real_server 10.0.0.98 82 {\n"
" weight 13\n\n"
" }\n\n"
"}\n\n")
rendered_obj = self.lvs_jinja_cfg.render_loadbalancer_obj(

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fix disabled UDP pools. Disabled UDP pools were marked as "OFFLINE" but the
requests were still forwarded to the members of the pool.