fix: host builder passes environment variables to spawned subprocesses#3577
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauron99 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3577 +/- ##
==========================================
+ Coverage 53.77% 56.27% +2.50%
==========================================
Files 180 180
Lines 20465 20504 +39
==========================================
+ Hits 11005 11539 +534
+ Misses 8354 7761 -593
- Partials 1106 1204 +98
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
01c4816 to
e302a7c
Compare
| ) | ||
|
|
||
| const ( | ||
| defaultRunHost = "127.0.0.1" // TODO allow to be altered via a runOpt |
There was a problem hiding this comment.
just removing the comment, we are already parsing the address
| cmd.Cancel = func() error { | ||
| if runtime.GOOS == "windows" { | ||
| // Interrupt is not implemented on windows apparently | ||
| return cmd.Process.Kill() | ||
| } | ||
| return cmd.Process.Signal(os.Interrupt) | ||
| } |
There was a problem hiding this comment.
the new Cancel function.
Windows apparently does not implement safer interrupt so we have to Kill
The runPython() and runGo() functions in runner.go were setting cmd.Env by appending to a nil slice, which discarded the parent environment and any func.yaml/CLI environment variables. Now both functions inherit the parent process environment via os.Environ() and inject Run.Envs using Interpolate(), matching the behavior of container-based builders.
e302a7c to
fa923cf
Compare
|
Yes it should be for python too. mustve lost it somewhere in m branch. Thanks! |
|
@matejvasek PTAL |
|
/aprove |
The runPython() and runGo() functions in runner.go were setting cmd.Env by appending to a nil slice, which discarded the parent environment and any func.yaml/CLI environment variables. Now both functions inherit the parent process environment via os.Environ() and inject Run.Envs using Interpolate(), matching the behavior of container-based builders.