virtcontainers: Remove the Network PostAdd method

It's used once by the sandbox code and can be implemented directly
there.

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
This commit is contained in:
Samuel Ortiz
2021-11-09 01:45:13 +00:00
committed by Samuel Ortiz
parent e0b264430d
commit c67109a251
3 changed files with 21 additions and 30 deletions

View File

@@ -826,7 +826,27 @@ func (s *Sandbox) createNetwork(ctx context.Context) error {
}
func (s *Sandbox) postCreatedNetwork(ctx context.Context) error {
return s.network.PostAdd(ctx, s.factory != nil)
if s.factory != nil {
return nil
}
if s.network.Endpoints() == nil {
return nil
}
for _, endpoint := range s.network.Endpoints() {
netPair := endpoint.NetworkPair()
if netPair == nil {
continue
}
if netPair.VhostFds != nil {
for _, VhostFd := range netPair.VhostFds {
VhostFd.Close()
}
}
}
return nil
}
func (s *Sandbox) removeNetwork(ctx context.Context) error {