diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-07 10:40:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 10:40:40 -0500 |
commit | e6f80fa61aa082d2226b8258ea247186451d84d3 (patch) | |
tree | 448b8674aa6edd152007e99d85432afe89fcf90c /pkg/api/handlers | |
parent | dc5da90523f35146f5368a31be7edf39be13beb4 (diff) | |
parent | 4a2498ff36d58a4c7358b9e7f824f0c8530f3a17 (diff) | |
download | podman-e6f80fa61aa082d2226b8258ea247186451d84d3.tar.gz podman-e6f80fa61aa082d2226b8258ea247186451d84d3.tar.bz2 podman-e6f80fa61aa082d2226b8258ea247186451d84d3.zip |
Merge pull request #8624 from mlegenovic/master
Docker compat API - containers create ignores the name
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r-- | pkg/api/handlers/compat/containers_create.go | 6 |
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 { |