diff options
author | Ondra Machacek <omachace@redhat.com> | 2021-10-20 18:45:56 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-11-12 11:08:25 -0500 |
commit | 3bd80ac9ae2ea512a5ce9140bedab742910d0513 (patch) | |
tree | 1b1aea3de4b1443ae687ecdb5a3ada4c19a4bf58 /pkg/bindings/connection.go | |
parent | a8332f69460f687d704cd804673b0ccca8fd5403 (diff) | |
download | podman-3bd80ac9ae2ea512a5ce9140bedab742910d0513.tar.gz podman-3bd80ac9ae2ea512a5ce9140bedab742910d0513.tar.bz2 podman-3bd80ac9ae2ea512a5ce9140bedab742910d0513.zip |
Handle HTTP 409 error messages properly for Pod actions
This PR fixes the case when the API return HTTP 409 response. Where the
API return the body format different then for other HTTP error codes.
Signed-off-by: Ondra Machacek <omachace@redhat.com>
Diffstat (limited to 'pkg/bindings/connection.go')
-rw-r--r-- | pkg/bindings/connection.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index e2c46e481..2fe86ca39 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -379,6 +379,11 @@ func (h *APIResponse) IsClientError() bool { return h.Response.StatusCode/100 == 4 } +// IsConflictError returns true if the response code is 409 +func (h *APIResponse) IsConflictError() bool { + return h.Response.StatusCode == 409 +} + // IsServerError returns true if the response code is 5xx func (h *APIResponse) IsServerError() bool { return h.Response.StatusCode/100 == 5 |