tests/docker: Use --userns=keep-id for podman
authorJohn Snow <jsnow@redhat.com>
Wed, 4 Sep 2019 23:24:51 +0000 (19:24 -0400)
committerAlex Bennée <alex.bennee@linaro.org>
Tue, 10 Sep 2019 08:38:33 +0000 (09:38 +0100)
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>
Message-Id: <20190904232451.26466-1-jsnow@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
tests/docker/docker.py

index e23209f71eea78c89209c806a60432b980ff42ec..064026c8af86594625dff54cec91584b1414919d 100755 (executable)
@@ -369,9 +369,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)