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

@ -319,17 +319,17 @@ func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerReq
}
}()
if err = s.runtime.CreateContainer(container, sb.cgroupParent); err != nil {
if err = s.Runtime().CreateContainer(container, sb.cgroupParent); err != nil {
return nil, err
}
if err = s.runtime.UpdateStatus(container); err != nil {
if err = s.Runtime().UpdateStatus(container); err != nil {
return nil, err
}
s.addContainer(container)
if err = s.ctrIDIndex.Add(containerID); err != nil {
if err = s.CtrIDIndex().Add(containerID); err != nil {
s.removeContainer(container)
return nil, err
}
@ -522,7 +522,7 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
}
}
// Join the namespace paths for the pod sandbox container.
podInfraState := s.runtime.ContainerStatus(sb.infraContainer)
podInfraState := s.Runtime().ContainerStatus(sb.infraContainer)
logrus.Debugf("pod container state %+v", podInfraState)
@ -611,7 +611,7 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
metaname := metadata.Name
attempt := metadata.Attempt
containerInfo, err := s.storageRuntimeServer.CreateContainer(s.imageContext,
containerInfo, err := s.storageRuntimeServer.CreateContainer(s.ImageContext(),
sb.name, sb.id,
image, image,
containerName, containerID,