Merge pull request #4882 from vieux/fix_merge_issue_tty
Fix merge issue tty Upstream-commit: 58b49e60bbd3d9d978ecf3e96f53b47fdcca8cce Component: engine
This commit is contained in:
@@ -62,3 +62,24 @@ func TestCommitNewFile(t *testing.T) {
|
||||
|
||||
logDone("commit - commit file and read")
|
||||
}
|
||||
|
||||
func TestCommitTTY(t *testing.T) {
|
||||
cmd := exec.Command(dockerBinary, "run", "-t", "--name", "tty", "busybox", "/bin/ls")
|
||||
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cmd = exec.Command(dockerBinary, "commit", "tty", "ttytest")
|
||||
imageId, _, err := runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
imageId = strings.Trim(imageId, "\r\n")
|
||||
|
||||
cmd = exec.Command(dockerBinary, "run", "ttytest", "/bin/ls")
|
||||
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,6 @@ package docker
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"github.com/dotcloud/docker/api/client"
|
||||
"github.com/dotcloud/docker/daemon"
|
||||
"github.com/dotcloud/docker/engine"
|
||||
"github.com/dotcloud/docker/image"
|
||||
"github.com/dotcloud/docker/pkg/term"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@@ -19,6 +13,13 @@ import (
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/dotcloud/docker/api/client"
|
||||
"github.com/dotcloud/docker/daemon"
|
||||
"github.com/dotcloud/docker/engine"
|
||||
"github.com/dotcloud/docker/image"
|
||||
"github.com/dotcloud/docker/pkg/term"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
)
|
||||
|
||||
func closeWrap(args ...io.Closer) error {
|
||||
|
||||
@@ -65,15 +65,6 @@ func Merge(userConf, imageConf *Config) error {
|
||||
}
|
||||
}
|
||||
|
||||
if !userConf.Tty {
|
||||
userConf.Tty = imageConf.Tty
|
||||
}
|
||||
if !userConf.OpenStdin {
|
||||
userConf.OpenStdin = imageConf.OpenStdin
|
||||
}
|
||||
if !userConf.StdinOnce {
|
||||
userConf.StdinOnce = imageConf.StdinOnce
|
||||
}
|
||||
if userConf.Env == nil || len(userConf.Env) == 0 {
|
||||
userConf.Env = imageConf.Env
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user