Skip to content

Commit ffe1b77

Browse files
committed
Watch OOMKilled event only when POD terminated
1 parent e6e7ea8 commit ffe1b77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

watcher_pods.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ func handlePodTerminationEvent(ctx context.Context, containerStatus *v1.Containe
2727
state := containerStatus.State.Terminated
2828

2929
logger.Trace().Msgf("Container state: %#v", state)
30-
if state.ExitCode == 0 {
31-
// Nothing to do
30+
if state.ExitCode == 0 || state.Reason != "OOMKilled" {
31+
// Ignore successful exits and anything that's not OOMKilled
3232
return nil
3333
}
3434

0 commit comments

Comments
 (0)