hashicorp / hashicorp/go-plugin
Can't override environment variables when running a plugin
Open
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 511
- Avg merge
- 22h 47m
- Merged PRs (30d)
- 4
Description
I want to modify an existing environment variable _just for the plugin_ without affecting the environment variables of my current process. Right now any custom environment variables set on the plugin command are set first, and then the ambient environment variables are set second, undoing changes to an existing environment variable.
https://github.com/hashicorp/go-plugin/blob/0c19a1387af146eaa3335dad0a021741344ac3e9/client.go#L530
I'll follow-up with a PR to switch it to the following to enable this scenario if that's okay.
```go
cmd.Env = append(os.Environ(), cmd.Env...)
```
Contributor guide
Assessment
This issue has not been assessed yet.