Merge pull request #24921 from feiskyer/merge-exec

Automatic merge from submit-queue

Remove RunInContainer interface in Kubelet Runtime interface

According to #24689, we should merge RunInContainer and ExecInContainer in the container runtime interface. 

@yujuhong  @kubernetes/sig-node
This commit is contained in:
k8s-merge-robot
2016-05-15 02:58:15 -07:00
12 changed files with 64 additions and 100 deletions

View File

@@ -1599,28 +1599,6 @@ func (r *Runtime) removePod(uuid string) error {
return errors.NewAggregate(errlist)
}
// Note: In rkt, the container ID is in the form of "UUID:appName", where
// appName is the container name.
// TODO(yifan): If the rkt is using lkvm as the stage1 image, then this function will fail.
func (r *Runtime) RunInContainer(containerID kubecontainer.ContainerID, cmd []string) ([]byte, error) {
glog.V(4).Infof("Rkt running in container.")
id, err := parseContainerID(containerID)
if err != nil {
return nil, err
}
args := append([]string{}, "enter", fmt.Sprintf("--app=%s", id.appName), id.uuid)
args = append(args, cmd...)
result, err := r.buildCommand(args...).CombinedOutput()
if err != nil {
if exitErr, ok := err.(*exec.ExitError); ok {
err = &rktExitError{exitErr}
}
}
return result, err
}
// rktExitError implemets /pkg/util/exec.ExitError interface.
type rktExitError struct{ *exec.ExitError }