fix: host builder passes environment variables to spawned subprocesses#3577
fix: host builder passes environment variables to spawned subprocesses#3577gauron99 wants to merge 1 commit intoknative:mainfrom
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.26% +2.49%
==========================================
Files 180 180
Lines 20465 20483 +18
==========================================
+ Hits 11005 11525 +520
+ Misses 8354 7755 -599
- Partials 1106 1203 +97
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:
|
97588a6 to
01c4816
Compare
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.
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.