aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers_create.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-07 17:28:28 -0500
committerGitHub <noreply@github.com>2020-12-07 17:28:28 -0500
commit23d2deed30c2491a2cf59644324f27c9eebf7ba4 (patch)
treee191f6ea97f53e22f9b43e04900fe9df1e65eef9 /pkg/api/handlers/compat/containers_create.go
parent4c424e845239aef6e8cdab93dc19f55f4314513c (diff)
parent33bde4569ccb65b447150894c56f9a351a09a471 (diff)
downloadpodman-23d2deed30c2491a2cf59644324f27c9eebf7ba4.tar.gz
podman-23d2deed30c2491a2cf59644324f27c9eebf7ba4.tar.bz2
podman-23d2deed30c2491a2cf59644324f27c9eebf7ba4.zip
Merge pull request #8640 from mheon/221_backports
Backports for v2.2.1
Diffstat (limited to 'pkg/api/handlers/compat/containers_create.go')
-rw-r--r--pkg/api/handlers/compat/containers_create.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go
index 729639928..409a74de2 100644
--- a/pkg/api/handlers/compat/containers_create.go
+++ b/pkg/api/handlers/compat/containers_create.go
@@ -37,6 +37,9 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
return
}
+ // Override the container name in the body struct
+ body.Name = query.Name
+
if len(body.HostConfig.Links) > 0 {
utils.Error(w, utils.ErrLinkNotSupport.Error(), http.StatusBadRequest, errors.Wrapf(utils.ErrLinkNotSupport, "bad parameter"))
return
@@ -69,9 +72,6 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
return
}
- // Override the container name in the body struct
- body.Name = query.Name
-
ic := abi.ContainerEngine{Libpod: runtime}
report, err := ic.ContainerCreate(r.Context(), sg)
if err != nil {