Merge pull request #3551 from crosbymichael/default-env
Remove the process default ENV
This commit is contained in:
		@@ -141,7 +141,6 @@ func populateDefaultUnixSpec(ctx context.Context, s *Spec, id string) error {
 | 
			
		||||
			Path: defaultRootfsPath,
 | 
			
		||||
		},
 | 
			
		||||
		Process: &specs.Process{
 | 
			
		||||
			Env:             defaultUnixEnv,
 | 
			
		||||
			Cwd:             "/",
 | 
			
		||||
			NoNewPrivileges: true,
 | 
			
		||||
			User: specs.User{
 | 
			
		||||
 
 | 
			
		||||
@@ -151,6 +151,13 @@ func WithEnv(environmentVariables []string) SpecOpts {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithDefaultPathEnv sets the $PATH environment variable to the
 | 
			
		||||
// default PATH defined in this package.
 | 
			
		||||
func WithDefaultPathEnv(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
 | 
			
		||||
	s.Process.Env = replaceOrAppendEnvValues(s.Process.Env, defaultUnixEnv)
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// replaceOrAppendEnvValues returns the defaults with the overrides either
 | 
			
		||||
// replaced by env key or appended to the list
 | 
			
		||||
func replaceOrAppendEnvValues(defaults, overrides []string) []string {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user