Skip to content

Commit 8d19982

Browse files
gthiemongeberendt
authored andcommitted
Fix fully-populated API with allowed_cidrs
When creating a LB + a listener with an allowed_cidr with the fully-populated API, an issue happened when Octavia validated that the allowed_cidrs and the VIP ip address have the same IP version. The vip.ip_address value was not updated in the load balancer object, forcing the expiration of the DB object before entering _graph_create fixes this issue. Note: there's no change in the tests, the test function for this feature exists, looks correct, and passes successfully, the bug is only reproducible in octavia-api. Closes-Bug: 2057751 Change-Id: Ia106d81c1b2588e5d938d2238c8a2f6660bf5ef1 (cherry picked from commit 5d9b23c)
1 parent fb7b560 commit 8d19982

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

octavia/api/v2/controllers/load_balancer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,13 @@ def post(self, load_balancer):
558558
subnet_id=add_vip.subnet_id)
559559

560560
if listeners or pools:
561+
# expire_all is required here, it ensures that the loadbalancer
562+
# will be re-fetched with its associated vip in _graph_create.
563+
# without expire_all the vip attributes that have been updated
564+
# just before this call may not be set correctly in the
565+
# loadbalancer object.
566+
lock_session.expire_all()
567+
561568
db_pools, db_lists = self._graph_create(
562569
lock_session, db_lb, listeners, pools)
563570

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed a bug when creating a load balancer and a listener with
5+
``allowed_cidrs`` with the fully-populated load balancer API, the call was
6+
rejected because Octavia could not validate that the IP addresses of the
7+
``allowed_cidrs`` have the same family as the VIP address.

0 commit comments

Comments
 (0)