mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-12 12:29:11 +00:00
network: Try removing as many changes as possible during network cleanup
In case an error is encountered while removing a network endpoint during network cleanup, we cuurently return immediately with the error. With this change, in case of error we simply log the error and proceed towards removing the next endpoint. With this, we can cleanup the network changes made by the shim as much as possible. This is especially important when multiple interfaces are passed to the network namespace using a network plugin like multus. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
@@ -437,7 +437,12 @@ func (n *LinuxNetwork) RemoveEndpoints(ctx context.Context, s *Sandbox, endpoint
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := n.removeSingleEndpoint(ctx, s, ep, hotplug); err != nil {
|
if err := n.removeSingleEndpoint(ctx, s, ep, hotplug); err != nil {
|
||||||
return err
|
// Log the error instead of returning right away
|
||||||
|
// Proceed to remove the next endpoint so as to clean the network setup as
|
||||||
|
// much as possible.
|
||||||
|
// This is crucial for physical endpoints as we want to bind back the physical
|
||||||
|
// interface to its original host driver.
|
||||||
|
networkLogger().Warnf("Error removing endpoint %v : %v", ep.Name(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user