@@ -318,8 +318,6 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro
318
318
return fmt .Errorf ("compile devcontainer.json: %w" , err )
319
319
}
320
320
if buildParams .User != "" {
321
- // BUG(mafredri): buildParams may set the user to remoteUser which
322
- // is incorrect, we should only override if containerUser is set.
323
321
runtimeData .ContainerUser = buildParams .User
324
322
}
325
323
runtimeData .Scripts = devContainer .LifecycleScripts
@@ -710,7 +708,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro
710
708
711
709
// Set the environment from /etc/environment first, so it can be
712
710
// overridden by the image and devcontainer settings.
713
- err = setEnvFromEtcEnvironment ()
711
+ err = setEnvFromEtcEnvironment (opts . Logger )
714
712
if err != nil {
715
713
return fmt .Errorf ("set env from /etc/environment: %w" , err )
716
714
}
@@ -1319,9 +1317,10 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error)
1319
1317
return image , nil
1320
1318
}
1321
1319
1322
- func setEnvFromEtcEnvironment () error {
1320
+ func setEnvFromEtcEnvironment (logf log. Func ) error {
1323
1321
environ , err := os .ReadFile ("/etc/environment" )
1324
1322
if errors .Is (err , os .ErrNotExist ) {
1323
+ logf (log .LevelDebug , "Not loading environment from /etc/environment, file does not exist" )
1325
1324
return nil
1326
1325
}
1327
1326
if err != nil {
0 commit comments