From f70976a7e2667d0fec73f57d24fa7ae5fbb546d7 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 24 Jul 2024 13:01:03 +0200 Subject: [PATCH] api: honor the userns for the infra container Signed-off-by: Giuseppe Scrivano --- pkg/api/handlers/libpod/pods.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go index 8bc081f160..1c2ee28505 100644 --- a/pkg/api/handlers/libpod/pods.go +++ b/pkg/api/handlers/libpod/pods.go @@ -46,6 +46,9 @@ func PodCreate(w http.ResponseWriter, r *http.Request) { infraOptions.Net = &entities.NetOptions{} infraOptions.Devices = psg.Devices infraOptions.SecurityOpt = psg.SecurityOpt + if !psg.Userns.IsDefault() { + infraOptions.UserNS = psg.Userns.String() + } if psg.ShareParent == nil { t := true psg.ShareParent = &t