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

Resolve environment without values to values on host #297

Merged
merged 2 commits into from
Jul 11, 2014

Conversation

ryanbrainard
Copy link

For parity with the Docker CLI, allow environment variables without values to be automatically resolved to their values on the host.

If someone defines an environment as a list, this also converts it to a dict so the above resolution works as expected. Defining environment as dict is canonical, but using a list already worked, so this conversion supports backward compatibility.

docker-py resolves environment with a value of None to the string 'None', which is not what someone would want if the value could not be found in the host's environment. This resolves that case to empty string, which is how Docker CLI also handles this situation.

Fixes #277

@d11wtq
Copy link

d11wtq commented Jul 8, 2014

👍

@ryanbrainard
Copy link
Author

@aanand This is an implementation of what you suggested in # 1 of your comment on #227. Just wanted to make sure you saw it.

@aanand
Copy link

aanand commented Jul 9, 2014

Yes! Was trying it out earlier - looks good. I'll merge it tomorrow.

On Tue, Jul 8, 2014 at 10:09 PM, Ryan Brainard notifications@github.com
wrote:

@aanand This is an implementation of what you suggested in # 1 of your comment on #227. Just wanted to make sure you saw it.

Reply to this email directly or view it on GitHub:
#297 (comment)

@bfirsh
Copy link

bfirsh commented Jul 11, 2014

Would be good to get documentation too.

@ryanbrainard
Copy link
Author

@bfirsh Just added documentation

@bfirsh
Copy link

bfirsh commented Jul 11, 2014

Great, thanks! Needs rebasing against master too.

For parity with the Docker CLI, allow environment variables without
values to be automatically resolved to their values on the host.

Signed-off-by: Ryan Brainard <brainard@heroku.com>

Conflicts:
	tests/integration/service_test.py
Signed-off-by: Ryan Brainard <brainard@heroku.com>
@ryanbrainard
Copy link
Author

@bfirsh Rebased and re-ran tests.

@bfirsh
Copy link

bfirsh commented Jul 11, 2014

Great stuff! Thanks so much, Ryan.

bfirsh added a commit that referenced this pull request Jul 11, 2014
Resolve environment without values to values on host
@bfirsh bfirsh merged commit 99d7a47 into docker:master Jul 11, 2014
@ryanbrainard
Copy link
Author

Thank you! :)

@dmitriy-kiriyenko dmitriy-kiriyenko mentioned this pull request Oct 28, 2014
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Resolve environment without values to values on host
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
xulike666 pushed a commit to xulike666/compose that referenced this pull request Jan 19, 2017
Sigchld reaper has been removed from containerd procss in
8476905, so the comment
is not need any more.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
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.

Secure way to handle environment variables?
4 participants