Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start the plugin using the configured stdin, if available #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carolynvs
Copy link

What is the change?

When the Cmd struct already has stdin already configured, use that instead of os.Stdin when starting a plugin.

Why?

I wanted to pass data to my plugins to assist with initialization, passing one-time configuration data that isn't part of the interface used to communicate with the plugin. I was having trouble getting this sent properly via os.Stdin honestly... 😊

This seems like an improvement because it doesn't require remembering the original os.Stdin and swapping it back, and makes it easier for the host to pass a different stdin to a plugin, or mock it out for a test.

When the command client had a stdin already configured, use that instead
of os.stdin when starting the plugin.
@hashicorp-cla
Copy link

hashicorp-cla commented Oct 25, 2019

CLA assistant check
All committers have signed the CLA.

carolynvs pushed a commit to carolynvs/porter that referenced this pull request Oct 25, 2019
carolynvs pushed a commit to carolynvs/porter that referenced this pull request Oct 28, 2019
carolynvs pushed a commit to getporter/porter that referenced this pull request Oct 29, 2019
* Use a patch of hashicorp/go-plugin

hashicorp/go-plugin#127

* Sync vendor

* Pass plugin config via stdin
@ghostsquad
Copy link

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants