mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-08-16 20:43:29 +00:00
Use authoritative Docker OOM evidence
This commit is contained in:
parent
e499f92360
commit
e3382c8bcb
32 changed files with 234 additions and 81 deletions
|
|
@ -305,6 +305,9 @@ func TestCollectContainer(t *testing.T) {
|
|||
if container.Health != "healthy" {
|
||||
t.Fatalf("expected health status, got %q", container.Health)
|
||||
}
|
||||
if container.OOMKilled == nil || *container.OOMKilled {
|
||||
t.Fatalf("expected authoritative non-OOM state, got %v", container.OOMKilled)
|
||||
}
|
||||
if container.BlockIO == nil {
|
||||
t.Fatalf("expected block IO to be populated")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -621,6 +621,7 @@ func (a *Agent) collectContainer(ctx context.Context, summary containertypes.Sum
|
|||
}
|
||||
}
|
||||
|
||||
oomKilled := inspect.State.OOMKilled
|
||||
container := agentsdocker.Container{
|
||||
ID: summary.ID,
|
||||
Name: trimLeadingSlash(summary.Names),
|
||||
|
|
@ -637,6 +638,7 @@ func (a *Agent) collectContainer(ctx context.Context, summary containertypes.Sum
|
|||
UptimeSeconds: uptimeSeconds,
|
||||
RestartCount: inspect.RestartCount,
|
||||
ExitCode: inspect.State.ExitCode,
|
||||
OOMKilled: &oomKilled,
|
||||
StartedAt: startedPtr,
|
||||
FinishedAt: finishedPtr,
|
||||
Ports: ports,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue