mirror of
https://github.com/containers/podman.git
synced 2025-06-06 15:00:40 +08:00
Merge pull request #4818 from haircommander/piped-exec-fix
exec: fix pipes
This commit is contained in:
@ -546,6 +546,10 @@ func (r *ConmonOCIRuntime) ExecContainer(c *Container, sessionID string, options
|
|||||||
args = append(args, "-t")
|
args = append(args, "-t")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.Streams.AttachInput {
|
||||||
|
args = append(args, "-i")
|
||||||
|
}
|
||||||
|
|
||||||
// Append container ID and command
|
// Append container ID and command
|
||||||
args = append(args, "-e")
|
args = append(args, "-e")
|
||||||
// TODO make this optional when we can detach
|
// TODO make this optional when we can detach
|
||||||
@ -558,9 +562,8 @@ func (r *ConmonOCIRuntime) ExecContainer(c *Container, sessionID string, options
|
|||||||
execCmd := exec.Command(r.conmonPath, args...)
|
execCmd := exec.Command(r.conmonPath, args...)
|
||||||
|
|
||||||
if options.Streams != nil {
|
if options.Streams != nil {
|
||||||
if options.Streams.AttachInput {
|
// Don't add the InputStream to the execCmd. Instead, the data should be passed
|
||||||
execCmd.Stdin = options.Streams.InputStream
|
// through CopyDetachable
|
||||||
}
|
|
||||||
if options.Streams.AttachOutput {
|
if options.Streams.AttachOutput {
|
||||||
execCmd.Stdout = options.Streams.OutputStream
|
execCmd.Stdout = options.Streams.OutputStream
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user