Decouple kubernetes-dependent an non-dependent parts of server

Move non-kubernetes-dependent portions of server struct to libkpod.
So far, only the struct fields have been moved and not their dependent
functions

Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This commit is contained in:
Ryan Cole 2017-07-17 08:25:32 -04:00
parent 4d6ff0b414
commit 64ad902480
24 changed files with 153 additions and 100 deletions

View file

@ -17,12 +17,12 @@ func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest
return nil, err
}
if err := s.runtime.UpdateStatus(c); err != nil {
if err := s.Runtime().UpdateStatus(c); err != nil {
return nil, err
}
cStatus := s.runtime.ContainerStatus(c)
cStatus := s.Runtime().ContainerStatus(c)
if cStatus.Status != oci.ContainerStateStopped {
if err := s.runtime.StopContainer(c, req.Timeout); err != nil {
if err := s.Runtime().StopContainer(c, req.Timeout); err != nil {
return nil, fmt.Errorf("failed to stop container %s: %v", c.ID(), err)
}
if err := s.storageRuntimeServer.StopContainer(c.ID()); err != nil {