summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-09 15:56:50 +0000
committerGitHub <noreply@github.com>2020-11-09 15:56:50 +0000
commitabc77b42219aaccf5cf1a1c9f1202c1525c0d807 (patch)
tree73b459205f83f70a6b17c779a7ffbe06a9c83aa3 /pkg/api/handlers
parente2b82e6245ed9459a37dc004a2b1d593d2835cb7 (diff)
parent71a46764041da966805dfb40cc0f2a89a2848307 (diff)
downloadpodman-abc77b42219aaccf5cf1a1c9f1202c1525c0d807.tar.gz
podman-abc77b42219aaccf5cf1a1c9f1202c1525c0d807.tar.bz2
podman-abc77b42219aaccf5cf1a1c9f1202c1525c0d807.zip
Merge pull request #8245 from baude/rootlesscreatecompat
rootless container creation settings
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/compat/containers_create.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go
index 87c95a24c..f9407df1a 100644
--- a/pkg/api/handlers/compat/containers_create.go
+++ b/pkg/api/handlers/compat/containers_create.go
@@ -38,6 +38,11 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
utils.Error(w, utils.ErrLinkNotSupport.Error(), http.StatusBadRequest, errors.Wrapf(utils.ErrLinkNotSupport, "bad parameter"))
return
}
+ rtc, err := runtime.GetConfig()
+ if err != nil {
+ utils.Error(w, "unable to obtain runtime config", http.StatusInternalServerError, errors.Wrap(err, "unable to get runtime config"))
+ }
+
newImage, err := runtime.ImageRuntime().NewFromLocal(input.Image)
if err != nil {
if errors.Cause(err) == define.ErrNoSuchImage {
@@ -50,7 +55,7 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) {
}
// Take input structure and convert to cliopts
- cliOpts, args, err := common.ContainerCreateToContainerCLIOpts(input)
+ cliOpts, args, err := common.ContainerCreateToContainerCLIOpts(input, rtc.Engine.CgroupManager)
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrap(err, "make cli opts()"))
return