mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-19 15:24:26 +01:00
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:
committed by
Samuel Ortiz
parent
e0b264430d
commit
c67109a251
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user