E2E: Delete multi-hop-net only when host-network isn't used
Deleting the multi-hop-net makes sense only if we created
it earlier, meaning when we're using a network other than
host for our containers.
@@ -203,10 +203,12 @@ func tearDownContainers(containers []*frrcontainer.FRR) error {
return err
}
+ if containersNetwork != "host" {
out, err := executor.Host.Exec(executor.ContainerRuntime, "network", "rm", multiHopNetwork)
if err != nil {
return errors.Wrapf(err, "failed to remove %s: %s", multiHopNetwork, out)
}
+ }
return nil
}
