diff mbox series

tests/docker: Use --userns=keep-id for podman

Message ID 20190904232451.26466-1-jsnow@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/docker: Use --userns=keep-id for podman | expand

Commit Message

John Snow Sept. 4, 2019, 11:24 p.m. UTC
The workaround that attempts to accomplish the same result as --userns=keep-id
does not appear to work well with UIDs much above 1000 (like mine, which is
above 20000.)

Since we have official support for this "trick" now, use the supported method.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 tests/docker/docker.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Alex Bennée Sept. 5, 2019, 10:06 a.m. UTC | #1
John Snow <jsnow@redhat.com> writes:

> The workaround that attempts to accomplish the same result as --userns=keep-id
> does not appear to work well with UIDs much above 1000 (like mine, which is
> above 20000.)
>
> Since we have official support for this "trick" now, use the supported method.
>
> Signed-off-by: John Snow <jsnow@redhat.com>

Queued to testing/next, thanks.

> ---
>  tests/docker/docker.py | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/tests/docker/docker.py b/tests/docker/docker.py
> index ac5baab4ca..fe17d5f709 100755
> --- a/tests/docker/docker.py
> +++ b/tests/docker/docker.py
> @@ -368,9 +368,7 @@ class RunCommand(SubCommand):
>              argv = [ "-u", str(uid) ] + argv
>              docker = Docker()
>              if docker._command[0] == "podman":
> -                argv = [ "--uidmap", "%d:0:1" % uid,
> -                         "--uidmap", "0:1:%d" % uid,
> -                         "--uidmap", "%d:%d:64536" % (uid + 1, uid + 1)] + argv
> +                argv.insert(0, '--userns=keep-id')
>          return Docker().run(argv, args.keep, quiet=args.quiet)


--
Alex Bennée
diff mbox series

Patch

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index ac5baab4ca..fe17d5f709 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -368,9 +368,7 @@  class RunCommand(SubCommand):
             argv = [ "-u", str(uid) ] + argv
             docker = Docker()
             if docker._command[0] == "podman":
-                argv = [ "--uidmap", "%d:0:1" % uid,
-                         "--uidmap", "0:1:%d" % uid,
-                         "--uidmap", "%d:%d:64536" % (uid + 1, uid + 1)] + argv
+                argv.insert(0, '--userns=keep-id')
         return Docker().run(argv, args.keep, quiet=args.quiet)