mirror of
https://github.com/containers/podman.git
synced 2025-06-09 17:07:51 +08:00
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>
This commit is contained in:
@ -438,9 +438,13 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode
|
|||||||
|
|
||||||
if c.IsSet("rm") {
|
if c.IsSet("rm") {
|
||||||
if err := r.Runtime.RemoveContainer(ctx, ctr, false, true); err != nil {
|
if err := r.Runtime.RemoveContainer(ctx, ctr, false, true); err != nil {
|
||||||
|
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)
|
logrus.Errorf("Error removing container %s: %v", ctr.ID(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return exitCode, nil
|
return exitCode, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user