Re-add PODMAN_USERNS environment variable

This was lost during the Podman 2.0 migration. Turns out to be a
very easy fix, fortunately - we want to use the environment var
if not explicitly overridden.

Fixes #6705

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2020-06-22 13:31:36 -04:00
parent 22942e392d
commit f329e2ad67

View File

@ -2,6 +2,7 @@ package common
import ( import (
"fmt" "fmt"
"os"
"github.com/containers/common/pkg/auth" "github.com/containers/common/pkg/auth"
"github.com/containers/libpod/cmd/podman/registry" "github.com/containers/libpod/cmd/podman/registry"
@ -464,7 +465,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"Username or UID (format: <name|uid>[:<group|gid>])", "Username or UID (format: <name|uid>[:<group|gid>])",
) )
createFlags.String( createFlags.String(
"userns", "", "userns", os.Getenv("PODMAN_USERNS"),
"User namespace to use", "User namespace to use",
) )
createFlags.String( createFlags.String(