mirror of
https://github.com/docker/compose.git
synced 2025-07-23 05:34:36 +02:00
don't include stderr in moby exec output
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
76cd14a85d
commit
4916b36b99
@ -136,5 +136,6 @@ func ExecSilent(ctx context.Context, args ...string) ([]byte, error) {
|
|||||||
args = os.Args[1:]
|
args = os.Args[1:]
|
||||||
}
|
}
|
||||||
cmd := exec.CommandContext(ctx, ComDockerCli, args...)
|
cmd := exec.CommandContext(ctx, ComDockerCli, args...)
|
||||||
return cmd.CombinedOutput()
|
cmd.Stderr = os.Stderr
|
||||||
|
return cmd.Output()
|
||||||
}
|
}
|
||||||
|
@ -398,8 +398,7 @@ func TestLegacy(t *testing.T) {
|
|||||||
t.Run("host flag", func(t *testing.T) {
|
t.Run("host flag", func(t *testing.T) {
|
||||||
res := c.RunDockerOrExitError("-H", "tcp://nonexistent:123", "version")
|
res := c.RunDockerOrExitError("-H", "tcp://nonexistent:123", "version")
|
||||||
assert.Assert(t, res.ExitCode == 1)
|
assert.Assert(t, res.ExitCode == 1)
|
||||||
assert.Assert(t, strings.Contains(res.Stdout(), "dial tcp: lookup nonexistent"), res.Stdout())
|
assert.Assert(t, strings.Contains(res.Stderr(), "dial tcp: lookup nonexistent"), res.Stderr())
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("remote engine context", func(t *testing.T) {
|
t.Run("remote engine context", func(t *testing.T) {
|
||||||
@ -408,7 +407,7 @@ func TestLegacy(t *testing.T) {
|
|||||||
|
|
||||||
res := c.RunDockerOrExitError("version")
|
res := c.RunDockerOrExitError("version")
|
||||||
assert.Assert(t, res.ExitCode == 1)
|
assert.Assert(t, res.ExitCode == 1)
|
||||||
assert.Assert(t, strings.Contains(res.Stdout(), "dial tcp: lookup nonexistent"), res.Stdout())
|
assert.Assert(t, strings.Contains(res.Stderr(), "dial tcp: lookup nonexistent"), res.Stderr())
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("existing contexts delegate", func(t *testing.T) {
|
t.Run("existing contexts delegate", func(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user