summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod/pods.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2021-08-10 12:55:52 +0000
committerGitHub <noreply@github.com>2021-08-10 12:55:52 +0000
commite136ad485c626e09e361c37bbd529bb599448ac0 (patch)
treee3b1c0a96222831481de1358e13dbb086185a9d3 /pkg/api/handlers/libpod/pods.go
parent6f61e229911e399d92f8fbe0574654f308f73b39 (diff)
parent221b1add74e17ded10e8f2f832a53065578aa264 (diff)
downloadpodman-e136ad485c626e09e361c37bbd529bb599448ac0.tar.gz
podman-e136ad485c626e09e361c37bbd529bb599448ac0.tar.bz2
podman-e136ad485c626e09e361c37bbd529bb599448ac0.zip
Merge pull request #10589 from umohnani8/pod-userns
Add support for pod inside of user namespace.
Diffstat (limited to 'pkg/api/handlers/libpod/pods.go')
-rw-r--r--pkg/api/handlers/libpod/pods.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go
index 4dc8740e2..ff105bc48 100644
--- a/pkg/api/handlers/libpod/pods.go
+++ b/pkg/api/handlers/libpod/pods.go
@@ -30,6 +30,12 @@ func PodCreate(w http.ResponseWriter, r *http.Request) {
utils.Error(w, "failed to decode specgen", http.StatusInternalServerError, errors.Wrap(err, "failed to decode specgen"))
return
}
+ // parse userns so we get the valid default value of userns
+ psg.Userns, err = specgen.ParseUserNamespace(psg.Userns.String())
+ if err != nil {
+ utils.Error(w, "failed to parse userns", http.StatusInternalServerError, errors.Wrap(err, "failed to parse userns"))
+ return
+ }
pod, err := generate.MakePod(&psg, runtime)
if err != nil {
httpCode := http.StatusInternalServerError