Track container IDs in index
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
e9ab839955
commit
edba913f67
1 changed files with 8 additions and 0 deletions
|
@ -99,6 +99,10 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
|
|||
|
||||
s.addContainer(container)
|
||||
|
||||
if err := s.ctrIDIndex.Add(containerID); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.CreateContainerResponse{
|
||||
ContainerId: &containerID,
|
||||
}, nil
|
||||
|
@ -397,6 +401,10 @@ func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerReq
|
|||
s.releaseContainerName(c.Name())
|
||||
s.removeContainer(c)
|
||||
|
||||
if err := s.ctrIDIndex.Delete(c.ID()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &pb.RemoveContainerResponse{}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue