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

@ -36,11 +36,11 @@ func (ss streamService) Exec(containerID string, cmd []string, stdin io.Reader,
return fmt.Errorf("could not find container %q", containerID)
}
if err := ss.runtimeServer.runtime.UpdateStatus(c); err != nil {
if err := ss.runtimeServer.Runtime().UpdateStatus(c); err != nil {
return err
}
cState := ss.runtimeServer.runtime.ContainerStatus(c)
cState := ss.runtimeServer.Runtime().ContainerStatus(c)
if !(cState.Status == oci.ContainerStateRunning || cState.Status == oci.ContainerStateCreated) {
return fmt.Errorf("container is not created or running")
}
@ -51,7 +51,7 @@ func (ss streamService) Exec(containerID string, cmd []string, stdin io.Reader,
}
args = append(args, c.ID())
args = append(args, cmd...)
execCmd := exec.Command(ss.runtimeServer.runtime.Path(c), args...)
execCmd := exec.Command(ss.runtimeServer.Runtime().Path(c), args...)
var cmdErr error
if tty {
p, err := kubecontainer.StartPty(execCmd)