Make kubectl run attach behave like docker run

Have stdin closed by default, can be left open with --leave-stdin-open.
Add e2e tests for the behavior.
This commit is contained in:
Clayton Coleman
2015-10-06 11:31:48 -04:00
parent e929baf91a
commit e9a465d635
9 changed files with 120 additions and 6 deletions

View File

@@ -1061,6 +1061,11 @@ func runKubectl(args ...string) string {
return newKubectlCommand(args...).exec()
}
// runKubectlInput is a convenience wrapper over kubectlBuilder that takes input to stdin
func runKubectlInput(data string, args ...string) string {
return newKubectlCommand(args...).withStdinData(data).exec()
}
func startCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error) {
stdout, err = cmd.StdoutPipe()
if err != nil {