Skip to content

Commit

Permalink
Report the pod exit reason in the event monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Apr 27, 2019
1 parent 0d827d3 commit c99e93f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/monitor/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func startPodMonitoring(ctx context.Context, m Recorder, client kubernetes.Inter
conditions = append(conditions, Condition{
Level: Error,
Locator: locatePodContainer(pod, s.Name),
Message: fmt.Sprintf("container exited with code %d: %s", t.ExitCode, t.Message),
Message: fmt.Sprintf("container exited with code %d (%s): %s", t.ExitCode, t.Reason, t.Message),
})
}
}
Expand All @@ -120,7 +120,7 @@ func startPodMonitoring(ctx context.Context, m Recorder, client kubernetes.Inter
conditions = append(conditions, Condition{
Level: Error,
Locator: locatePodContainer(pod, s.Name),
Message: fmt.Sprintf("init container exited with code %d: %s", t.ExitCode, t.Message),
Message: fmt.Sprintf("init container exited with code %d (%s): %s", t.ExitCode, t.Reason, t.Message),
})
}
}
Expand Down Expand Up @@ -159,7 +159,7 @@ func startPodMonitoring(ctx context.Context, m Recorder, client kubernetes.Inter
conditions = append(conditions, Condition{
Level: Error,
Locator: locatePodContainer(pod, s.Name),
Message: fmt.Sprintf("container exited with code %d: %s", t.ExitCode, t.Message),
Message: fmt.Sprintf("container exited with code %d (%s): %s", t.ExitCode, t.Reason, t.Message),
})
}
if s.RestartCount != previous.RestartCount {
Expand Down Expand Up @@ -187,7 +187,7 @@ func startPodMonitoring(ctx context.Context, m Recorder, client kubernetes.Inter
conditions = append(conditions, Condition{
Level: Error,
Locator: locatePodContainer(pod, s.Name),
Message: fmt.Sprintf("init container exited with code %d: %s", t.ExitCode, t.Message),
Message: fmt.Sprintf("init container exited with code %d (%s): %s", t.ExitCode, t.Reason, t.Message),
})
}
if s.RestartCount != previous.RestartCount {
Expand Down

0 comments on commit c99e93f

Please sign in to comment.