Skip to content

Commit 9c26443

Browse files
committed
pr fixes
1 parent 0e8b049 commit 9c26443

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

envbuilder.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,6 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro
318318
return fmt.Errorf("compile devcontainer.json: %w", err)
319319
}
320320
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.
323321
runtimeData.ContainerUser = buildParams.User
324322
}
325323
runtimeData.Scripts = devContainer.LifecycleScripts
@@ -710,7 +708,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro
710708

711709
// Set the environment from /etc/environment first, so it can be
712710
// overridden by the image and devcontainer settings.
713-
err = setEnvFromEtcEnvironment()
711+
err = setEnvFromEtcEnvironment(opts.Logger)
714712
if err != nil {
715713
return fmt.Errorf("set env from /etc/environment: %w", err)
716714
}
@@ -1319,9 +1317,10 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error)
13191317
return image, nil
13201318
}
13211319

1322-
func setEnvFromEtcEnvironment() error {
1320+
func setEnvFromEtcEnvironment(logf log.Func) error {
13231321
environ, err := os.ReadFile("/etc/environment")
13241322
if errors.Is(err, os.ErrNotExist) {
1323+
logf(log.LevelDebug, "Not loading environment from /etc/environment, file does not exist")
13251324
return nil
13261325
}
13271326
if err != nil {

0 commit comments

Comments
 (0)