runtime: use GetRootlessUID() to get rootless uid

otherwise it won't work in a user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-06-27 13:52:29 +02:00
parent fccf4ad503
commit bfcf0292de
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
1 changed files with 1 additions and 1 deletions

View File

@ -373,7 +373,7 @@ func NewRuntimeFromConfig(ctx context.Context, userConfigPath string, options ..
func homeDir() (string, error) {
home := os.Getenv("HOME")
if home == "" {
usr, err := user.Current()
usr, err := user.LookupId(fmt.Sprintf("%d", rootless.GetRootlessUID()))
if err != nil {
return "", errors.Wrapf(err, "unable to resolve HOME directory")
}