Merge pull request #15276 from yifan-gu/rkt_probe
Auto commit by PR queue bot
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
appcschema "github.com/appc/spec/schema"
|
appcschema "github.com/appc/spec/schema"
|
||||||
@@ -46,6 +47,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/securitycontext"
|
"k8s.io/kubernetes/pkg/securitycontext"
|
||||||
"k8s.io/kubernetes/pkg/types"
|
"k8s.io/kubernetes/pkg/types"
|
||||||
"k8s.io/kubernetes/pkg/util"
|
"k8s.io/kubernetes/pkg/util"
|
||||||
|
utilexec "k8s.io/kubernetes/pkg/util/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -1099,8 +1101,25 @@ func (r *Runtime) RunInContainer(containerID kubecontainer.ContainerID, cmd []st
|
|||||||
args := append([]string{}, "enter", fmt.Sprintf("--app=%s", id.appName), id.uuid)
|
args := append([]string{}, "enter", fmt.Sprintf("--app=%s", id.appName), id.uuid)
|
||||||
args = append(args, cmd...)
|
args = append(args, cmd...)
|
||||||
|
|
||||||
result, err := r.runCommand(args...)
|
result, err := r.buildCommand(args...).CombinedOutput()
|
||||||
return []byte(strings.Join(result, "\n")), err
|
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 }
|
||||||
|
|
||||||
|
var _ utilexec.ExitError = &rktExitError{}
|
||||||
|
|
||||||
|
func (r *rktExitError) ExitStatus() int {
|
||||||
|
if status, ok := r.Sys().(syscall.WaitStatus); ok {
|
||||||
|
return status.ExitStatus()
|
||||||
|
}
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Runtime) AttachContainer(containerID kubecontainer.ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool) error {
|
func (r *Runtime) AttachContainer(containerID kubecontainer.ContainerID, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool) error {
|
||||||
|
Reference in New Issue
Block a user