summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers_create.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/compat/containers_create.go')
-rw-r--r--pkg/api/handlers/compat/containers_create.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go
index 87c95a24c..24e25f526 100644
--- a/pkg/api/handlers/compat/containers_create.go
+++ b/pkg/api/handlers/compat/containers_create.go
@@ -49,6 +49,9 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
return
}
+ // Add the container name to the input struct
+ input.Name = query.Name
+
// Take input structure and convert to cliopts
cliOpts, args, err := common.ContainerCreateToContainerCLIOpts(input)
if err != nil {
@@ -60,6 +63,7 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "fill out specgen"))
return
}
+
ic := abi.ContainerEngine{Libpod: runtime}
report, err := ic.ContainerCreate(r.Context(), sg)
if err != nil {