diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-01 15:54:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-01 15:54:27 +0200 |
commit | 150778820f0f6d9f7ffdb672a8b136804378f025 (patch) | |
tree | b959b53d288816c3c36fb5b054a19075d65a3c34 /pkg/adapter/containers.go | |
parent | ed394070a895654ad3ffbabd81a3033b0c7088ff (diff) | |
parent | 4f56964d556a7379c09a903258fd44c2232a686a (diff) | |
download | podman-150778820f0f6d9f7ffdb672a8b136804378f025.tar.gz podman-150778820f0f6d9f7ffdb672a8b136804378f025.tar.bz2 podman-150778820f0f6d9f7ffdb672a8b136804378f025.zip |
Merge pull request #3324 from marcov/detach-keys-configurable
libpod: specify a detach keys sequence in libpod.conf
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r-- | pkg/adapter/containers.go | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go index 898df5fce..10720886b 100644 --- a/pkg/adapter/containers.go +++ b/pkg/adapter/containers.go @@ -384,8 +384,18 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode } } } + + config, err := r.Runtime.GetConfig() + if err != nil { + return exitCode, err + } + detachKeys := c.String("detach-keys") + if detachKeys == "" { + detachKeys = config.DetachKeys + } + // if the container was created as part of a pod, also start its dependencies, if any. - if err := StartAttachCtr(ctx, ctr, outputStream, errorStream, inputStream, c.String("detach-keys"), c.Bool("sig-proxy"), true, c.IsSet("pod")); err != nil { + if err := StartAttachCtr(ctx, ctr, outputStream, errorStream, inputStream, detachKeys, c.Bool("sig-proxy"), true, c.IsSet("pod")); err != nil { // We've manually detached from the container // Do not perform cleanup, or wait for container exit code // Just exit immediately @@ -410,10 +420,6 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode if errors.Cause(err) == define.ErrNoSuchCtr { // The container may have been removed // Go looking for an exit file - config, err := r.Runtime.GetConfig() - if err != nil { - return exitCode, err - } ctrExitCode, err := ReadExitFile(config.TmpDir, ctr.ID()) if err != nil { logrus.Errorf("Cannot get exit code: %v", err) |