From 68f7254cbb932ef194ce2a38497dbbe94ee38e4b Mon Sep 17 00:00:00 2001 From: Kaylyn Bogle Date: Fri, 1 Dec 2023 12:29:48 -0800 Subject: [PATCH] Fix podman agent container in v2 Add additional string matching to determine when container is not found or running when invoked via podman compatibility socket --- 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 67bde06a21..accba49d5b 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