summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-11-15 11:48:28 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-11-15 14:36:23 -0500
commit364b242b70d9593e782a3d099bfc4ba04d8b3a2d (patch)
treebf35595c2a4841297904b517ea5ff2f3bad167fc /cmd/podman
parentcca6df428cb9ce187ae1341740ac1137c7a67a75 (diff)
downloadpodman-364b242b70d9593e782a3d099bfc4ba04d8b3a2d.tar.gz
podman-364b242b70d9593e782a3d099bfc4ba04d8b3a2d.tar.bz2
podman-364b242b70d9593e782a3d099bfc4ba04d8b3a2d.zip
Set config environment variables early in Podman init
Fixes: https://github.com/containers/podman/issues/12296 [NO NEW TESTS NEEDED] because there is no easy way to test this. Tests are in containers/common. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/root.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 418a70e1e..9e4c8d24d 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -163,20 +163,6 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
return err
}
- for _, env := range cfg.Engine.Env {
- splitEnv := strings.SplitN(env, "=", 2)
- if len(splitEnv) != 2 {
- return fmt.Errorf("invalid environment variable for engine %s, valid configuration is KEY=value pair", env)
- }
- // skip if the env is already defined
- if _, ok := os.LookupEnv(splitEnv[0]); ok {
- logrus.Debugf("environment variable %s is already defined, skip the settings from containers.conf", splitEnv[0])
- continue
- }
- if err := os.Setenv(splitEnv[0], splitEnv[1]); err != nil {
- return err
- }
- }
// Hard code TMPDIR functions to use /var/tmp, if user did not override
if _, ok := os.LookupEnv("TMPDIR"); !ok {
if tmpdir, err := cfg.ImageCopyTmpDir(); err != nil {