Skip to content

Commit

Permalink
pkg/bindings/containers: handle ignore for stop
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Luap99 committed Aug 12, 2024
1 parent 6fce734 commit 5ec413f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/bindings/containers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5ec413f

Please sign in to comment.