rootless: fix create with images not in the storage

This chunk was mistakenly removed with ecec1a5430

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 <gscrivan@redhat.com>

Closes: #1521
Approved by: baude
This commit is contained in:
Giuseppe Scrivano 2018-09-21 10:59:52 +02:00 committed by Atomic Bot
parent 37b2601a81
commit c4b15ce46b
2 changed files with 8 additions and 0 deletions

View File

@ -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")

View File

@ -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 {