Separate container state from sandbox state in server

Move container state data to libkpod, separate from the sandbox
data in server.  However, the move was structured such that sandbox
data could easily be moved over into libkpod in the future

Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This commit is contained in:
Ryan Cole 2017-07-18 11:01:08 -04:00
parent 0eb5cd527f
commit bd540ac94c
4 changed files with 51 additions and 12 deletions

View file

@ -31,7 +31,7 @@ func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersReque
logrus.Debugf("ListContainersRequest %+v", req)
var ctrs []*pb.Container
filter := req.Filter
ctrList := s.state.containers.List()
ctrList := s.ContainerServer.ListContainers()
// Filter using container id and pod id first.
if filter != nil {
@ -40,7 +40,7 @@ func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersReque
if err != nil {
return nil, err
}
c := s.state.containers.Get(id)
c := s.ContainerServer.GetContainer(id)
if c != nil {
if filter.PodSandboxId != "" {
if c.Sandbox() == filter.PodSandboxId {