summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/containers.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-04-17 11:01:45 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-17 13:22:06 -0500
commit44a8cf867665927111fe9ea03711c8fabfc7d4a2 (patch)
treecac0714b1d0e4ae4636c03191f4752235dd1a38d /pkg/domain/infra/abi/containers.go
parentd68b028c9440cd3f952327b05f1bc8dee00ab98a (diff)
downloadpodman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.tar.gz
podman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.tar.bz2
podman-44a8cf867665927111fe9ea03711c8fabfc7d4a2.zip
Fixes for system tests
Various fixes to protect against regressions in system tests Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r--pkg/domain/infra/abi/containers.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index c9df72f2d..50003dbe2 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -736,6 +736,16 @@ func (ic *ContainerEngine) ContainerRun(ctx context.Context, opts entities.Conta
} else {
report.ExitCode = int(ecode)
}
+ if opts.Rm {
+ if err := ic.Libpod.RemoveContainer(ctx, ctr, false, true); err != nil {
+ if errors.Cause(err) == define.ErrNoSuchCtr ||
+ errors.Cause(err) == define.ErrCtrRemoved {
+ logrus.Warnf("Container %s does not exist: %v", ctr.ID(), err)
+ } else {
+ logrus.Errorf("Error removing container %s: %v", ctr.ID(), err)
+ }
+ }
+ }
return &report, nil
}