summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/container.go9
-rw-r--r--pkg/specgen/generate/oci.go1
2 files changed, 9 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index 59fee80f1..06ffa3df6 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -86,6 +86,15 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
s.Env = envLib.Join(envLib.Join(defaultEnvs, envs), s.Env)
+ // Ensure that default environment variables are populated.
+ // Container must have PATH and TERM set, even if nothing else set them.
+ baseEnv := envLib.DefaultEnvVariables()
+ for k, v := range baseEnv {
+ if _, ok := s.Env[k]; !ok {
+ s.Env[k] = v
+ }
+ }
+
// Labels and Annotations
annotations := make(map[string]string)
if newImage != nil {
diff --git a/pkg/specgen/generate/oci.go b/pkg/specgen/generate/oci.go
index f1c9f2a1a..aefc7204c 100644
--- a/pkg/specgen/generate/oci.go
+++ b/pkg/specgen/generate/oci.go
@@ -260,7 +260,6 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt
for key, val := range s.Annotations {
g.AddAnnotation(key, val)
}
- g.AddProcessEnv("container", "podman")
g.Config.Linux.Resources = s.ResourceLimits