diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/common/create.go | 7 | ||||
-rw-r--r-- | cmd/podman/common/create_opts.go | 1 | ||||
-rw-r--r-- | cmd/podman/common/specgen.go | 29 | ||||
-rw-r--r-- | cmd/podman/containers/create.go | 12 | ||||
-rw-r--r-- | cmd/podman/containers/run.go | 3 | ||||
-rw-r--r-- | cmd/podman/images/pull.go | 1 | ||||
-rw-r--r-- | cmd/podman/root.go | 2 |
7 files changed, 20 insertions, 35 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index d0bc8d466..2b6f9348e 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -323,13 +323,16 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "override-arch", "", "use `ARCH` instead of the architecture of the machine for choosing images", ) - // markFlagHidden(createFlags, "override-arch") createFlags.StringVar( &cf.OverrideOS, "override-os", "", "use `OS` instead of the running OS for choosing images", ) - // markFlagHidden(createFlags, "override-os") + createFlags.StringVar( + &cf.OverrideVariant, + "override-variant", "", + "Use _VARIANT_ instead of the running architecture variant for choosing images", + ) createFlags.String( "pid", "", "PID namespace to use", diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index 16d41988f..1b0e64590 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -65,6 +65,7 @@ type ContainerCLIOpts struct { OOMScoreAdj int OverrideArch string OverrideOS string + OverrideVariant string PID string PIDsLimit *int64 Pod string diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index 4de622916..e7b88eb3f 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -307,10 +307,11 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string // ENVIRONMENT VARIABLES // // Precedence order (higher index wins): - // 1) env-host, 2) image data, 3) env-file, 4) env - env := map[string]string{ - "container": "podman", - } + // 1) containers.conf (EnvHost, EnvHTTP, Env) 2) image data, 3 User EnvHost/EnvHTTP, 4) env-file, 5) env + // containers.conf handled and image data handled on the server side + // user specified EnvHost and EnvHTTP handled on Server Side relative to Server + // env-file and env handled on client side + var env map[string]string // First transform the os env into a map. We need it for the labels later in // any case. @@ -319,24 +320,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string return errors.Wrap(err, "error parsing host environment variables") } - if c.EnvHost { - env = envLib.Join(env, osEnv) - } else if c.HTTPProxy { - for _, envSpec := range []string{ - "http_proxy", - "HTTP_PROXY", - "https_proxy", - "HTTPS_PROXY", - "ftp_proxy", - "FTP_PROXY", - "no_proxy", - "NO_PROXY", - } { - if v, ok := osEnv[envSpec]; ok { - env[envSpec] = v - } - } - } + s.EnvHost = c.EnvHost + s.HTTPProxy = c.HTTPProxy // env-file overrides any previous variables for _, f := range c.EnvFile { diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go index 801547033..5e48aa622 100644 --- a/cmd/podman/containers/create.go +++ b/cmd/podman/containers/create.go @@ -66,9 +66,6 @@ func createFlags(flags *pflag.FlagSet) { _ = flags.MarkHidden("env-host") _ = flags.MarkHidden("http-proxy") } - // Not sure we want these exposed yet. If we do, they need to be documented in man pages - _ = flags.MarkHidden("override-arch") - _ = flags.MarkHidden("override-os") } func init() { @@ -254,10 +251,11 @@ func pullImage(imageName string) (string, error) { return "", errors.Wrapf(define.ErrNoSuchImage, "unable to find a name and tag match for %s in repotags", imageName) } pullReport, pullErr := registry.ImageEngine().Pull(registry.GetContext(), imageName, entities.ImagePullOptions{ - Authfile: cliVals.Authfile, - Quiet: cliVals.Quiet, - OverrideArch: cliVals.OverrideArch, - OverrideOS: cliVals.OverrideOS, + Authfile: cliVals.Authfile, + Quiet: cliVals.Quiet, + OverrideArch: cliVals.OverrideArch, + OverrideOS: cliVals.OverrideOS, + OverrideVariant: cliVals.OverrideVariant, }) if pullErr != nil { return "", pullErr diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go index a84cb6814..34eea14e1 100644 --- a/cmd/podman/containers/run.go +++ b/cmd/podman/containers/run.go @@ -70,9 +70,6 @@ func runFlags(flags *pflag.FlagSet) { _ = flags.MarkHidden("http-proxy") _ = flags.MarkHidden("preserve-fds") } - // Not sure we want these exposed yet. If we do, they need to be documented in man pages - _ = flags.MarkHidden("override-arch") - _ = flags.MarkHidden("override-os") } func init() { registry.Commands = append(registry.Commands, registry.CliCommand{ diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index 4deaecbf5..d86f9800c 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -82,6 +82,7 @@ func pullFlags(flags *pflag.FlagSet) { flags.StringVar(&pullOptions.CredentialsCLI, "creds", "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry") flags.StringVar(&pullOptions.OverrideArch, "override-arch", "", "Use `ARCH` instead of the architecture of the machine for choosing images") flags.StringVar(&pullOptions.OverrideOS, "override-os", "", "Use `OS` instead of the running OS for choosing images") + flags.StringVar(&pullOptions.OverrideVariant, "override-variant", "", " use VARIANT instead of the running architecture variant for choosing images") flags.Bool("disable-content-trust", false, "This is a Docker specific option and is a NOOP") flags.BoolVarP(&pullOptions.Quiet, "quiet", "q", false, "Suppress output information when pulling images") flags.StringVar(&pullOptions.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)") diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 8f77e5893..749a5fbe7 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -226,7 +226,7 @@ func persistentPostRunE(cmd *cobra.Command, args []string) error { func loggingHook() { var found bool for _, l := range logLevels { - if l == logLevel { + if l == strings.ToLower(logLevel) { found = true break } |