aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Ramer <tyaramer@gmail.com>2019-10-25 13:59:43 -0400
committerTyler Ramer <tyaramer@gmail.com>2019-10-25 16:25:42 -0400
commit1d00acee19f88406073cf1207f3944b3ad3046c3 (patch)
tree5e6a3d5a9794f57fbe3cebeb858d44c91deccd28
parenta01cb220c8389adaeaa8fb2b4c4fbd65e77c0529 (diff)
downloadpodman-1d00acee19f88406073cf1207f3944b3ad3046c3.tar.gz
podman-1d00acee19f88406073cf1207f3944b3ad3046c3.tar.bz2
podman-1d00acee19f88406073cf1207f3944b3ad3046c3.zip
Log warn instead of error for removing nonexistant container
In event of a container removal that is no longer in database, log a warning instead of an error, as there is not any problem continuing execution. Resolves #4314 Signed-off-by: Tyler Ramer <tyaramer@gmail.com>
-rw-r--r--pkg/adapter/containers.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index bff93cc9e..73e6dba3a 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -438,7 +438,11 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode
if c.IsSet("rm") {
if err := r.Runtime.RemoveContainer(ctx, ctr, false, true); err != nil {
- logrus.Errorf("Error removing container %s: %v", ctr.ID(), err)
+ if errors.Cause(err) == define.ErrNoSuchCtr {
+ logrus.Warnf("Container %s does not exist: %v", ctr.ID(), err)
+ } else {
+ logrus.Errorf("Error removing container %s: %v", ctr.ID(), err)
+ }
}
}