Commit graph

10 commits

Author SHA1 Message Date
Valentin Rothberg 68b94338ba linter: enable makezero
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-22 13:04:35 +01:00
Valentin Rothberg ea08765f40 go fmt: use go 1.18 conditional-build syntax
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-18 09:11:53 +01:00
Jason T. Greene 4693fc6db1 Implement env parsing on Windows
Fixes #12056
Also, enables existing parsing logic for all Unix derived OSs

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-01-19 12:05:04 -06:00
Daniel J Walsh 185294cb8c
Generate kube should'd add podman default environment vars
Currently we add the default PATH, TERM and container from Podman
to every kubernetes.yaml file. These values should not be recorded
in the yaml files.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-21 09:03:31 -04:00
Matthew Heon a7e864e6e7 Ensure DefaultEnvVariables is used in Specgen
When we rewrote Podman's pkg/spec, one of the things that was
lost was our use of a set of default environment variables, that
ensure all containers have at least $PATH and $TERM set.

While we're in the process of re-adding it, change it from a
variable to a function, so we can ensure the Join function does
not overwrite it and corrupt the defaults.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-08-18 15:17:46 -04:00
Brent Baude 70e6b2e6dd make env handling os dependent
environment variables are handled differently on windows vs linux.  here we split them to be handled but no actually processing of windows environment variables was done.  it can be added for future.  hoowever, now we dont get errors on windows about processing them.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-02 08:28:08 -05:00
OpenShift Merge Robot 797da2a57b
Merge pull request #5381 from vrothberg/ENVFIX
env: set "container" to current binary
2020-03-04 13:26:48 -05:00
Valentin Rothberg 6d2d6898f8 env: don't set "container" env
Leave setting the "container" variable to consumers of pkg/env.
Podman is now hard-setting it to "podman" while "libpod" will
set it internally to "libpod" if it's unset.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-04 17:07:47 +01:00
Brent Baude 822d5a486a avoid adding to nil map
we need to make the environment map to avoid throwing an error when trying to add an environment value from file.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-03 17:00:50 -06:00
Valentin Rothberg ad8e0e5e49 consolidate env handling into pkg/env
Env-variable related code is scattered across several packages making it
hard to maintain and extend.  Consolidate the code into a new pkg/env
package.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-03-03 11:47:24 +01:00