mirror of
https://github.com/containers/podman.git
synced 2025-06-29 23:22:40 +08:00
Do not print error message when container does not exist
This fixes a condition when a container is removed while following the logs and prints an error when the container is removed forcefully. Signed-off-by: jgallucci32 <john.gallucci.iv@gmail.com>
This commit is contained in:
@ -78,9 +78,11 @@ func (c *Container) readFromLogFile(options *logs.LogOptions, logChannel chan *l
|
|||||||
if options.Follow {
|
if options.Follow {
|
||||||
for {
|
for {
|
||||||
state, err := c.State()
|
state, err := c.State()
|
||||||
if err != nil {
|
if err != nil && errors.Cause(err) != define.ErrNoSuchCtr {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
break
|
break
|
||||||
|
} else if err != nil {
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if state != define.ContainerStateRunning && state != define.ContainerStatePaused {
|
if state != define.ContainerStateRunning && state != define.ContainerStatePaused {
|
||||||
err := t.Stop()
|
err := t.Stop()
|
||||||
|
Reference in New Issue
Block a user