summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r--pkg/varlinkapi/containers.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go
index 94726bbbd..55427771c 100644
--- a/pkg/varlinkapi/containers.go
+++ b/pkg/varlinkapi/containers.go
@@ -846,11 +846,6 @@ func (i *LibpodAPI) ExecContainer(call iopodman.VarlinkCall, opts iopodman.ExecO
workDir = *opts.Workdir
}
- var detachKeys string
- if opts.DetachKeys != nil {
- detachKeys = *opts.DetachKeys
- }
-
resizeChan := make(chan remotecommand.TerminalSize)
reader, writer, _, pipeWriter, streams := setupStreams(call)
@@ -870,8 +865,17 @@ func (i *LibpodAPI) ExecContainer(call iopodman.VarlinkCall, opts iopodman.ExecO
}
}()
+ execConfig := new(libpod.ExecConfig)
+ execConfig.Command = opts.Cmd
+ execConfig.Terminal = opts.Tty
+ execConfig.Privileged = opts.Privileged
+ execConfig.Environment = envs
+ execConfig.User = user
+ execConfig.WorkDir = workDir
+ execConfig.DetachKeys = opts.DetachKeys
+
go func() {
- ec, err := ctr.Exec(opts.Tty, opts.Privileged, envs, opts.Cmd, user, workDir, streams, 0, resizeChan, detachKeys)
+ ec, err := ctr.Exec(execConfig, streams, resizeChan)
if err != nil {
logrus.Errorf(err.Error())
}