Repository navigation
Conversation
Signed-off-by: Daniel Nephin <[email protected]>
| var, _, default = named.partition('-') | ||
| val = mapping.get(var, default) | ||
| else: | ||
| val = mapping[named] |
There was a problem hiding this comment.
There's some duplication here in the top two branches which I think we can remove.
I also prefer early returns instead of elif/else blocks.
|
Thanks for the PR. My PR isn't going to make it into 1.7.0 because code freeze is happening in a few days. So we have lots of time to get this into the next release. |
d0bf233 to
5d5b3de
Compare
5d5b3de to
fdf6c88
Compare
|
I've pushed a squashed version. I was able to run tests locally with tox. The unit tests are passing and I've switched back to early returns. |
|
It'd be nice to see it make it into 1.7, but I understand if it can't. This is something we really struggle with where compose doesn't work well with a purist 12 factors approach where you want a set of environment defaults. Even the priority of the various environment vars is strange compared to docker itself. In docker the environment vars are overridden with a priority hierarchy. The priorities for docker are from highest priority to lowest command line specified, shell specified, Dockerfile specified. Where in compose the compose file takes precedence over the shell environment and they cannot be set on the command line. You can specify an alternative env_file... The difference in how the environment vars are handled between the two is a little disorienting in all honesty. |
|
The Dockerfile and compose file are very different things, I wouldn't expect them to behave the same way. |
|
The differences in the files is secondary to the more salient point that With docker run or docker-compose run there may have been environment docker-compose up/build lack that particular feature, which is why this PR ᐧ On Fri, Mar 18, 2016 at 12:33 PM, Daniel Nephin [email protected]
Darrel O'Pry |
9c4f9cd to
b00a451
Compare
|
Thanks for working on this. It looks like we might be getting this feature into Compose 1.9. I ended up adding a similar change to my PR. |
|
No worries, thanks for the upstream work. On Thu, Sep 29, 2016 at 12:20 PM, Daniel Nephin [email protected]
Darrel O'Pry |
I'd really like to see this make it in and you already have a PR open. I'm having trouble testing locally on windows, mounts don't work with the docker containers quite like I'd expect.
cheers.