Skip to content

Commit

Permalink
Capture logs from terminated containers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
scothis authored and boz committed Feb 8, 2020
1 parent 01cbb7a commit 86a06d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 86a06d3

Please sign in to comment.