From c4b15ce46b1f49404d5b43b9fd50b14ac7fbee60 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 21 Sep 2018 10:59:52 +0200 Subject: rootless: fix create with images not in the storage This chunk was mistakenly removed with ecec1a5430885baf96d2e3d6153c7454c41a4617 Introduce it back as it solves the pull of an image that is not yet in the storage when using create/run. Signed-off-by: Giuseppe Scrivano Closes: #1521 Approved by: baude --- cmd/podman/create.go | 4 ++++ cmd/podman/run.go | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'cmd') diff --git a/cmd/podman/create.go b/cmd/podman/create.go index 07e75ad3a..39f6076b9 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -61,6 +61,10 @@ func createCmd(c *cli.Context) error { return err } + if os.Geteuid() != 0 { + rootless.SetSkipStorageSetup(true) + } + runtime, err := libpodruntime.GetContainerRuntime(c) if err != nil { return errors.Wrapf(err, "error creating libpod runtime") diff --git a/cmd/podman/run.go b/cmd/podman/run.go index 2a031de05..ce7d0c40f 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -10,6 +10,7 @@ import ( "github.com/containers/libpod/cmd/podman/libpodruntime" "github.com/containers/libpod/libpod" + "github.com/containers/libpod/pkg/rootless" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" @@ -39,6 +40,9 @@ func runCmd(c *cli.Context) error { if err := createInit(c); err != nil { return err } + if os.Geteuid() != 0 { + rootless.SetSkipStorageSetup(true) + } runtime, err := libpodruntime.GetContainerRuntime(c) if err != nil { -- cgit v1.2.3-54-g00ecf