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

listener/tcp: better handling of min/max port env vars #111

Merged
merged 3 commits into from
May 9, 2019

Conversation

calvn
Copy link
Member

@calvn calvn commented Apr 15, 2019

This PR addresses the case where PLUGIN_MIN_PORT and/or PLUGIN_MAX_PORT are not set and thus treated as empty strings. In this case, strconv.ParseInt will error and and the plugin will fail to run.

This PR sets those values as 0 if not provided and lets the OS handle the port assignment (by effectively giving it an address of 127.0.0.1:0). It also handles the case where the min port might be provided as a value larger than the max port, which would skip listener instantiation and error with "Couldn't bind plugin TCP listener".

Related to hashicorp/vault#6587

@kalafut
Copy link

kalafut commented Apr 15, 2019

Also related: #107

@calvn
Copy link
Member Author

calvn commented Apr 16, 2019

Also added the error wrapping from #110 to this PR. Apologies in advance for hijacking that PR!

@arykalin
Copy link

Hi. Is there any information then it will be merged?

@calvn calvn requested a review from briankassouf April 29, 2019 18:16
@tr1ck3r
Copy link

tr1ck3r commented May 9, 2019

@briankassouf is there a target release for this fix? This issue is currently preventing people from being about to use the PKI plugins that Venafi has developed for Vault.

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.

None yet

5 participants