Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: Add missing API release calls
Browse files Browse the repository at this point in the history
Add missing release sandbox calls to network related functions in
virtcontainers API.

Fixes #732.

Signed-off-by: Ruidong Cao <[email protected]>
  • Loading branch information
caoruidong committed Oct 17, 2018
1 parent d00742f commit 3f39d6e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions virtcontainers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,12 @@ func toggleInterface(ctx context.Context, sandboxID string, inf *grpc.Interface,
if err != nil {
return nil, err
}
defer s.releaseStatelessSandbox()

if add {
return s.AddInterface(inf)
}

return s.RemoveInterface(inf)
}

Expand Down Expand Up @@ -906,6 +909,7 @@ func ListInterfaces(ctx context.Context, sandboxID string) ([]*grpc.Interface, e
if err != nil {
return nil, err
}
defer s.releaseStatelessSandbox()

return s.ListInterfaces()
}
Expand All @@ -926,6 +930,8 @@ func UpdateRoutes(ctx context.Context, sandboxID string, routes []*grpc.Route) (
if err != nil {
return nil, err
}
defer s.releaseStatelessSandbox()

return s.UpdateRoutes(routes)
}

Expand All @@ -945,6 +951,7 @@ func ListRoutes(ctx context.Context, sandboxID string) ([]*grpc.Route, error) {
if err != nil {
return nil, err
}
defer s.releaseStatelessSandbox()

return s.ListRoutes()
}

0 comments on commit 3f39d6e

Please sign in to comment.