From 5ec413fac796dc21a5a2d779d72cccc687d3c1de Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 12 Aug 2024 15:25:37 +0200 Subject: [PATCH] pkg/bindings/containers: handle ignore for stop When the client gets a 404 back we know the container does not exists, if ignore is set as well we should just ignore the error client side. seen in #23554 Signed-off-by: Paul Holzinger --- pkg/bindings/containers/containers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/bindings/containers/containers.go b/pkg/bindings/containers/containers.go index 116ed91875..5665db2110 100644 --- a/pkg/bindings/containers/containers.go +++ b/pkg/bindings/containers/containers.go @@ -405,6 +405,9 @@ func Stop(ctx context.Context, nameOrID string, options *StopOptions) error { return err } defer response.Body.Close() + if options.GetIgnore() && response.StatusCode == http.StatusNotFound { + return nil + } return response.Process(nil) }