Skip to content

Commit

Permalink
✨ Better pod OOM reporting. (#521)
Browse files Browse the repository at this point in the history
Using the container status `Reason` for more accurate reporting.
```
state: Failed
image: quay.io/jortel/tackle2-addon-analyzer:debug
pod: konveyor-tackle/task-13-gcmjs
retries: 1
started: 2023-10-16T10:36:30.221282042-07:00
terminated: 2023-10-16T10:36:40.301254088-07:00
bucket:
    id: 17
    name: ""
errors:
    - severity: Error
      description: 'Pod failed: OOMKilled'
```

Also, the RWX should be disabled by default.

---------

Signed-off-by: Jeff Ortel <jortel@redhat.com>
  • Loading branch information
jortel authored Oct 16, 2023
1 parent d971779 commit e8dbcc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions settings/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ func (r *Hub) Load() (err error) {
if found {
b, _ := strconv.ParseBool(s)
r.Cache.RWX = b
} else {
r.Cache.RWX = true
}
r.Cache.PVC, found = os.LookupEnv(EnvCachePvc)
if !found {
Expand Down
5 changes: 4 additions & 1 deletion task/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ func (r *Task) Reflect(client k8s.Client) (err error) {
r.State = Succeeded
r.Terminated = &mark
case core.PodFailed:
r.Error("Error", "Pod failed: %s", pod.Status.Message)
r.Error(
"Error",
"Pod failed: %s",
pod.Status.ContainerStatuses[0].State.Terminated.Reason)
switch pod.Status.ContainerStatuses[0].State.Terminated.ExitCode {
case 137: // Killed.
if r.Retries < Settings.Hub.Task.Retries {
Expand Down

0 comments on commit e8dbcc1

Please sign in to comment.