From 86a06d38d88769534b39606127f29a39503e505f Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Wed, 29 May 2019 17:02:05 -0400 Subject: [PATCH] Capture logs from terminated containers If a container has a very short life, sometimes it is captured in the logs collected by kail and sometimes not. This occurs when the container exits before kail is able to see the container is alive and collect logs. This should be a backwards compatible change since the SinceSeconds value is generally quite small and still applies. --- filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filter.go b/filter.go index df0d8d7..148c27b 100644 --- a/filter.go +++ b/filter.go @@ -18,7 +18,7 @@ func NewContainerFilter(names []string) ContainerFilter { type containerFilter []string func (cf containerFilter) Accept(cs v1.ContainerStatus) bool { - if cs.State.Running == nil { + if cs.State.Running == nil && cs.State.Terminated == nil { return false } if len(cf) == 0 {