events: support "die" filter

Map "die" to the "died" status for Docker compat.

Fixes: #16857
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2022-12-21 14:03:56 +01:00
parent 5211446516
commit 45b180c1f8
3 changed files with 17 additions and 1 deletions

View File

@ -21,6 +21,9 @@ func generateEventFilter(filter, filterValue string) (func(e *Event) bool, error
return strings.HasPrefix(e.ID, filterValue)
}, nil
case "EVENT", "STATUS":
if filterValue == "die" { // Docker compat
filterValue = "died"
}
return func(e *Event) bool {
return string(e.Status) == filterValue
}, nil