Merge pull request #1017 from baude/cri_tests_sandbox

server/sandbox_list.go: No error on filtered list find by ID
This commit is contained in:
Daniel J Walsh 2017-10-18 16:10:11 -04:00 committed by GitHub
commit c2b7f37bd3

View file

@ -42,7 +42,11 @@ func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxReque
if filter.Id != "" {
id, err := s.PodIDIndex().Get(filter.Id)
if err != nil {
return nil, err
// Not finding an ID in a filtered list should not be considered
// and error; it might have been deleted when stop was done.
// Log and return an empty struct.
logrus.Warn("unable to find pod %s with filter", filter.Id)
return &pb.ListPodSandboxResponse{}, nil
}
sb := s.getSandbox(id)
if sb == nil {