summaryrefslogtreecommitdiff
path: root/pkg/api/server/register_pods.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2021-01-19 09:16:01 -0700
committerJhon Honce <jhonce@redhat.com>2021-02-02 12:44:08 -0700
commit7e4d696d949f4132c17a9c66c9f24e65b184be4c (patch)
tree4601ecb29e0184944a1928ee55ce9a1f541a71dc /pkg/api/server/register_pods.go
parentd66a18cb11688060a3ef737dd05758398279f053 (diff)
downloadpodman-7e4d696d949f4132c17a9c66c9f24e65b184be4c.tar.gz
podman-7e4d696d949f4132c17a9c66c9f24e65b184be4c.tar.bz2
podman-7e4d696d949f4132c17a9c66c9f24e65b184be4c.zip
Report StatusConflict on Pod opt partial failures
- When one or more containers in the Pod reports an error on an operation report StatusConflict and report the error(s) - jsoniter type encoding used to marshal error as string using error.Error() - Update test framework to allow setting any flag when creating pods - Fix test_resize() result check Fixes #8865 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/api/server/register_pods.go')
-rw-r--r--pkg/api/server/register_pods.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkg/api/server/register_pods.go b/pkg/api/server/register_pods.go
index 105de4ee7..4873eb926 100644
--- a/pkg/api/server/register_pods.go
+++ b/pkg/api/server/register_pods.go
@@ -43,6 +43,11 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// $ref: "#/definitions/IdResponse"
// 400:
// $ref: "#/responses/BadParamError"
+ // 409:
+ // description: status conflict
+ // schema:
+ // type: string
+ // description: message describing error
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/create"), s.APIHandler(libpod.PodCreate)).Methods(http.MethodPost)
@@ -149,7 +154,7 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// 404:
// $ref: "#/responses/NoSuchPod"
// 409:
- // $ref: "#/responses/ConflictError"
+ // $ref: "#/responses/PodKillReport"
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/kill"), s.APIHandler(libpod.PodKill)).Methods(http.MethodPost)
@@ -170,6 +175,8 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// $ref: '#/responses/PodPauseReport'
// 404:
// $ref: "#/responses/NoSuchPod"
+ // 409:
+ // $ref: '#/responses/PodPauseReport'
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/pause"), s.APIHandler(libpod.PodPause)).Methods(http.MethodPost)
@@ -189,6 +196,8 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// $ref: '#/responses/PodRestartReport'
// 404:
// $ref: "#/responses/NoSuchPod"
+ // 409:
+ // $ref: "#/responses/PodRestartReport"
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/restart"), s.APIHandler(libpod.PodRestart)).Methods(http.MethodPost)
@@ -210,6 +219,8 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// $ref: "#/responses/PodAlreadyStartedError"
// 404:
// $ref: "#/responses/NoSuchPod"
+ // 409:
+ // $ref: '#/responses/PodStartReport'
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/start"), s.APIHandler(libpod.PodStart)).Methods(http.MethodPost)
@@ -237,6 +248,8 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// $ref: "#/responses/BadParamError"
// 404:
// $ref: "#/responses/NoSuchPod"
+ // 409:
+ // $ref: "#/responses/PodStopReport"
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/stop"), s.APIHandler(libpod.PodStop)).Methods(http.MethodPost)
@@ -256,6 +269,8 @@ func (s *APIServer) registerPodsHandlers(r *mux.Router) error {
// $ref: '#/responses/PodUnpauseReport'
// 404:
// $ref: "#/responses/NoSuchPod"
+ // 409:
+ // $ref: '#/responses/PodUnpauseReport'
// 500:
// $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/pods/{name}/unpause"), s.APIHandler(libpod.PodUnpause)).Methods(http.MethodPost)