summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/events.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2022-08-25 14:10:49 -0400
committerMatthew Heon <mheon@redhat.com>2022-09-06 14:28:59 -0400
commit063f332416c16532ada2465c3be53f1d4d8c8966 (patch)
tree1067141c795c085b9cff628fd65058e7f16ba946 /pkg/api/handlers/compat/events.go
parent2aa71bf29a1386f4f6295f34a80bcd269eed660a (diff)
downloadpodman-063f332416c16532ada2465c3be53f1d4d8c8966.tar.gz
podman-063f332416c16532ada2465c3be53f1d4d8c8966.tar.bz2
podman-063f332416c16532ada2465c3be53f1d4d8c8966.zip
Compat API image remove events now have 'delete' status
Change only the compat API, so we don't force a breaking change on Libpod API users. Partial fix for #15485 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/api/handlers/compat/events.go')
-rw-r--r--pkg/api/handlers/compat/events.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go
index 18fb35966..105404a0d 100644
--- a/pkg/api/handlers/compat/events.go
+++ b/pkg/api/handlers/compat/events.go
@@ -89,6 +89,12 @@ func GetEvents(w http.ResponseWriter, r *http.Request) {
}
e := entities.ConvertToEntitiesEvent(*evt)
+ // Some events differ between Libpod and Docker endpoints.
+ // Handle these differences for Docker-compat.
+ if !utils.IsLibpodRequest(r) && e.Type == "image" && e.Status == "remove" {
+ e.Status = "delete"
+ e.Action = "delete"
+ }
if !utils.IsLibpodRequest(r) && e.Status == "died" {
e.Status = "die"
e.Action = "die"