From 01bc6bdda87b00f8050cd94a2ad807159ba0da8a Mon Sep 17 00:00:00 2001
From: maybe-sybr <58414429+maybe-sybr@users.noreply.github.com>
Date: Wed, 24 Jun 2020 15:06:06 +1000
Subject: APIv2: Return `StatusCreated` from volume creation

The swagdoc in `register_volumes.go` already correctly notes that a 201
should be returned upon success, so we only need to change the handler
to match the spec.

Signed-off-by: Matt Brindley <58414429+maybe-sybr@users.noreply.github.com>
---
 pkg/api/handlers/libpod/volumes.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'pkg')

diff --git a/pkg/api/handlers/libpod/volumes.go b/pkg/api/handlers/libpod/volumes.go
index ea035fc4d..4b3b5430b 100644
--- a/pkg/api/handlers/libpod/volumes.go
+++ b/pkg/api/handlers/libpod/volumes.go
@@ -73,7 +73,7 @@ func CreateVolume(w http.ResponseWriter, r *http.Request) {
 		UID:        config.UID,
 		GID:        config.GID,
 	}
-	utils.WriteResponse(w, http.StatusOK, volResponse)
+	utils.WriteResponse(w, http.StatusCreated, volResponse)
 }
 
 func InspectVolume(w http.ResponseWriter, r *http.Request) {
-- 
cgit v1.2.3-54-g00ecf