diff mbox series

[ovs-dev,1/2] controller: Update related ports when parent of container is deleted.

Message ID 20241014104537.3311385-1-xsimonar@redhat.com
State Superseded
Headers show
Series [ovs-dev,1/2] controller: Update related ports when parent of container is deleted. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_ovn-kubernetes success github build: passed
ovsrobot/github-robot-_Build_and_Test fail github build: failed

Commit Message

Xavier Simonart Oct. 14, 2024, 10:45 a.m. UTC
There were a few cases where container ports was not removed from related ports
when the parent was deleted.
For instance, when a vif is bound to chassis 1 becomes claimed by chassis 2 and
is deleted before it's postponed on chassis 1.

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
---
 controller/binding.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/controller/binding.c b/controller/binding.c
index 492aef530..f749f74c9 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -2794,15 +2794,15 @@  handle_deleted_vif_lport(const struct sbrec_port_binding *pb,
          binding_lport_delete(binding_lports, b_lport);
     }
 
-    if ((lbinding && lport_type == LP_VIF) &&
-        (bound || sset_find_and_delete(b_ctx_out->postponed_ports,
-                                       pb->logical_port))) {
+    if (lbinding && lport_type == LP_VIF) {
+        sset_find_and_delete(b_ctx_out->postponed_ports, pb->logical_port);
         /* We need to release the container/virtual binding lports (if any) if
          * deleted 'pb' type is LP_VIF. */
         struct binding_lport *c_lport;
         LIST_FOR_EACH (c_lport, list_node, &lbinding->binding_lports) {
             sset_find_and_delete(b_ctx_out->postponed_ports, c_lport->name);
             remove_local_lports(c_lport->pb->logical_port, b_ctx_out);
+            remove_related_lport(c_lport->pb, b_ctx_out);
             if (!release_binding_lport(b_ctx_in->chassis_rec, c_lport,
                                        !b_ctx_in->ovnsb_idl_txn,
                                        b_ctx_out)) {