mirror of
https://github.com/containers/podman.git
synced 2025-08-03 01:37:51 +08:00
userns: add new option --userns=keep-id
it creates a namespace where the current UID:GID on the host is mapped to the same UID:GID in the container. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
. "github.com/containers/libpod/test/utils"
|
||||
@ -76,4 +77,12 @@ var _ = Describe("Podman UserNS support", func() {
|
||||
Expect(ok).To(BeTrue())
|
||||
})
|
||||
|
||||
It("podman --userns=keep-id", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--userns=keep-id", "alpine", "id", "-u"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
uid := fmt.Sprintf("%d", os.Geteuid())
|
||||
ok, _ := session.GrepString(uid)
|
||||
Expect(ok).To(BeTrue())
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user