From bc95443853f4b83a3acd1bea6816fe0881b6246a Mon Sep 17 00:00:00 2001 From: Kaylyn Bogle Date: Sat, 2 Dec 2023 11:22:23 -0800 Subject: [PATCH] Fix podman agent container in v2 (#2897) Add additional string matching to determine when container is not found or running when invoked via podman compatibility socket Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com> --- pipeline/backend/docker/docker.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipeline/backend/docker/docker.go b/pipeline/backend/docker/docker.go index 67bde06a2..accba49d5 100644 --- a/pipeline/backend/docker/docker.go +++ b/pipeline/backend/docker/docker.go @@ -361,8 +361,9 @@ var ( func isErrContainerNotFoundOrNotRunning(err error) bool { // Error response from daemon: Cannot kill container: ...: No such container: ... // Error response from daemon: Cannot kill container: ...: Container ... is not running" + // Error response from podman daemon: can only kill running containers. ... is in state exited // Error: No such container: ... - return err != nil && (strings.Contains(err.Error(), "No such container") || strings.Contains(err.Error(), "is not running")) + return err != nil && (strings.Contains(err.Error(), "No such container") || strings.Contains(err.Error(), "is not running") || strings.Contains(err.Error(), "can only kill running containers")) } // normalizeArchType converts the arch type reported by docker info into