summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-01-08 09:42:43 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-01-11 17:35:39 -0500
commit1c1e670d40826bed50ea43c197d1944018263738 (patch)
tree5ae4480fc7390b044ec08e3359c41636cf40bce6 /pkg/specgen/generate
parent63d8f535ec93b5e83257e39b9d656747c4bedfcc (diff)
downloadpodman-1c1e670d40826bed50ea43c197d1944018263738.tar.gz
podman-1c1e670d40826bed50ea43c197d1944018263738.tar.bz2
podman-1c1e670d40826bed50ea43c197d1944018263738.zip
Use HTTPProxy settings from containers.conf
This PR takes the settings from containers.conf and uses them. This works on the podman local but does not fix the issue for podman remote or for APIv2. We need a way to specify optionalbooleans when creating containers. Fixes: https://github.com/containers/podman/issues/8843 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/container.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index c771e8bc8..2feb1d3b2 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -100,15 +100,9 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
if err != nil {
return nil, err
}
- // First transform the os env into a map. We need it for the labels later in
- // any case.
- osEnv, err := envLib.ParseSlice(os.Environ())
- if err != nil {
- return nil, errors.Wrap(err, "error parsing host environment variables")
- }
// Get Default Environment from containers.conf
- defaultEnvs, err := envLib.ParseSlice(rtc.GetDefaultEnv())
+ defaultEnvs, err := envLib.ParseSlice(rtc.GetDefaultEnvEx(s.EnvHost, s.HTTPProxy))
if err != nil {
return nil, errors.Wrap(err, "error parsing fields in containers.conf")
}
@@ -133,6 +127,12 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
defaultEnvs = envLib.Join(defaultEnvs, envs)
}
+ // First transform the os env into a map. We need it for the labels later in
+ // any case.
+ osEnv, err := envLib.ParseSlice(os.Environ())
+ if err != nil {
+ return nil, errors.Wrap(err, "error parsing host environment variables")
+ }
// Caller Specified defaults
if s.EnvHost {
defaultEnvs = envLib.Join(defaultEnvs, osEnv)