summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-10-28 13:06:56 -0400
committerGitHub <noreply@github.com>2019-10-28 13:06:56 -0400
commit94864adb2888c6648bd061004e81dd20f8a30280 (patch)
treefd56f2c101b1a152beebb8f0596d79837d28b197
parentf438b2cc09d5b6eef3d09e8b8e3d3dcf2c6727df (diff)
parent1d00acee19f88406073cf1207f3944b3ad3046c3 (diff)
downloadpodman-94864adb2888c6648bd061004e81dd20f8a30280.tar.gz
podman-94864adb2888c6648bd061004e81dd20f8a30280.tar.bz2
podman-94864adb2888c6648bd061004e81dd20f8a30280.zip
Merge pull request #4347 from tylarb/Warn_NoSuchCtr
Log warn instead of error for removing nonexistant container
-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)
+ }
}
}