hashicorp / hashicorp/go-plugin

Can't override environment variables when running a plugin

Open
#162 0 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.