diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-17 07:18:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-17 07:18:37 -0400 |
commit | 39f1bea46dbdbefb917d361726e8452e9fa5c276 (patch) | |
tree | 18b4ae331ab8900eb4a3caab594ea2bce1aab3ab /pkg/domain/infra | |
parent | 28d331d074df093f82b294d60390e5a61c68cab0 (diff) | |
parent | eefa3cbf6ea351667ab06020347c308d082bdf2c (diff) | |
download | podman-39f1bea46dbdbefb917d361726e8452e9fa5c276.tar.gz podman-39f1bea46dbdbefb917d361726e8452e9fa5c276.tar.bz2 podman-39f1bea46dbdbefb917d361726e8452e9fa5c276.zip |
Merge pull request #8045 from andylibrian/podman-remote-cleanly-exit-on-detachkeyspressed
Update podman-remote run and start to handle detach keys
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/tunnel/containers.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go index 1bb4e68ac..eb591d23d 100644 --- a/pkg/domain/infra/tunnel/containers.go +++ b/pkg/domain/infra/tunnel/containers.go @@ -500,7 +500,6 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri if err == define.ErrDetach { // User manually detached // Exit cleanly immediately - report.Err = err reports = append(reports, &report) return reports, nil } @@ -573,6 +572,10 @@ func (ic *ContainerEngine) ContainerRun(ctx context.Context, opts entities.Conta // Attach if err := startAndAttach(ic, con.ID, &opts.DetachKeys, opts.InputStream, opts.OutputStream, opts.ErrorStream); err != nil { + if err == define.ErrDetach { + return &report, nil + } + report.ExitCode = define.ExitCode(err) if opts.Rm { if rmErr := containers.Remove(ic.ClientCxt, con.ID, bindings.PFalse, bindings.PTrue); rmErr != nil { |