From d514e3c09705c64b6cbcef70216a6edea9c8515a Mon Sep 17 00:00:00 2001 From: jgallucci32 Date: Fri, 12 Jun 2020 12:59:58 -0700 Subject: 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 --- libpod/container_log.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libpod/container_log.go') diff --git a/libpod/container_log.go b/libpod/container_log.go index da3ed3113..769f776d0 100644 --- a/libpod/container_log.go +++ b/libpod/container_log.go @@ -78,9 +78,11 @@ func (c *Container) readFromLogFile(options *logs.LogOptions, logChannel chan *l if options.Follow { for { state, err := c.State() - if err != nil { + if err != nil && errors.Cause(err) != define.ErrNoSuchCtr { logrus.Error(err) break + } else if err != nil { + break } if state != define.ContainerStateRunning && state != define.ContainerStatePaused { err := t.Stop() -- cgit v1.2.3-54-g00ecf