server: fix pod filter by truncated id

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-12-06 12:12:52 +01:00
parent 15f23bc6ac
commit e7492ca12f
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
2 changed files with 11 additions and 1 deletions

View file

@ -39,7 +39,11 @@ func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxReque
// Filter by pod id first.
if filter != nil {
if filter.Id != nil {
sb := s.getSandbox(*filter.Id)
id, err := s.podIDIndex.Get(*filter.Id)
if err != nil {
return nil, err
}
sb := s.getSandbox(id)
if sb == nil {
podList = []*sandbox{}
} else {