diff options
author | Peter Hunt <pehunt@redhat.com> | 2019-07-22 15:56:58 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2019-07-23 13:29:33 -0400 |
commit | 5bf99a82ff48cd5097182c55fe1347daf793324b (patch) | |
tree | 726fc427fba4615f2262932d71a8f9676604e3e4 /pkg/varlinkapi | |
parent | 479eeac62cd74e32cbe74fc8afbfc82d4d8a8abd (diff) | |
download | podman-5bf99a82ff48cd5097182c55fe1347daf793324b.tar.gz podman-5bf99a82ff48cd5097182c55fe1347daf793324b.tar.bz2 podman-5bf99a82ff48cd5097182c55fe1347daf793324b.zip |
add detach keys support for remote
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/containers.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go index fa17bed84..97eb36014 100644 --- a/pkg/varlinkapi/containers.go +++ b/pkg/varlinkapi/containers.go @@ -782,6 +782,9 @@ func (i *LibpodAPI) ExecContainer(call iopodman.VarlinkCall, opts iopodman.ExecO fmt.Sprintf("exec requires a running container, %s is %s", ctr.ID(), state.String())) } + // ACK the client upgrade request + call.ReplyExecContainer() + envs := []string{} if opts.Env != nil { envs = *opts.Env @@ -796,8 +799,11 @@ func (i *LibpodAPI) ExecContainer(call iopodman.VarlinkCall, opts iopodman.ExecO if opts.Workdir != nil { workDir = *opts.Workdir } - // ACK the client upgrade request - call.ReplyExecContainer() + + var detachKeys string + if opts.DetachKeys != nil { + detachKeys = *opts.DetachKeys + } resizeChan := make(chan remotecommand.TerminalSize) @@ -818,11 +824,10 @@ func (i *LibpodAPI) ExecContainer(call iopodman.VarlinkCall, opts iopodman.ExecO } }() - // TODO FIXME detach keys go func() { - ec, err := ctr.Exec(opts.Tty, opts.Privileged, envs, opts.Cmd, user, workDir, streams, 0, resizeChan, "") + ec, err := ctr.Exec(opts.Tty, opts.Privileged, envs, opts.Cmd, user, workDir, streams, 0, resizeChan, detachKeys) if err != nil { - logrus.Errorf("ExecContainer Exec err %s, %s\n", err.Error(), errors.Cause(err).Error()) + logrus.Errorf(err.Error()) } ecErrChan <- ExitCodeError{ uint32(ec), |