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

Commit

Permalink
sandbox: Remove redundant check
Browse files Browse the repository at this point in the history
Remove the check in `unsetAndRemoveSandboxStorage()`; that exact check
is performed by the called function `unSetSandboxStorage()`.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Jul 18, 2019
1 parent 72fc0ad commit d167490
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,21 +411,18 @@ func (s *sandbox) unsetAndRemoveSandboxStorage(path string) error {
span.SetTag("path", path)
defer span.Finish()

if _, ok := s.storages[path]; ok {
removeSbs, err := s.unSetSandboxStorage(path)
if err != nil {
return err
}
removeSbs, err := s.unSetSandboxStorage(path)
if err != nil {
return err
}

if removeSbs {
if err := s.removeSandboxStorage(path); err != nil {
return err
}
if removeSbs {
if err := s.removeSandboxStorage(path); err != nil {
return err
}

return nil
}
return grpcStatus.Errorf(codes.NotFound, "Sandbox storage with path %s not found", path)

return nil
}

func (s *sandbox) getContainer(id string) (*container, error) {
Expand Down

0 comments on commit d167490

Please sign in to comment.