podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

Fix environment variable precedents

Open wgnathanael opened this issue 2 years ago • 1 comments

Allow environment variables set in the host os to override the value of a variable defined in a .env file. This is consistent with docker's environment variable precedence. Per https://docs.docker.com/compose/environment-variables/envvars-precedence/#advanced-example

wgnathanael avatar Sep 13 '23 13:09 wgnathanael

I'd love to submit some tests but I can't even find existing tests that test the env/env-file features as is. Is there one I can use a template someplace?

wgnathanael avatar Mar 21 '24 14:03 wgnathanael

@p12tic bump on this issue. I (and presumably @wgnathanael) would love to get this merged as I am currently relying on it in my own fork to be able to use podman-compose in production, but it needs tests. Happy to contribute some, but as @wgnathanael says, there doesn't seem to be any infrastructure in place for testing the existing environment variable code. Do you have any sense of how this could be tested in a reasonably straightforward way?

charliemirabile avatar Jun 18 '24 18:06 charliemirabile

Thanks for the bump, I somehow missed @wgnathanael comment. If there is no testing infrastructure for a feature, it's more of a responsibility of the maintainer to define one instead of infrequent contributors. I will merge this PR as is.

p12tic avatar Jun 22 '24 16:06 p12tic

Rebased and fixed merge conflict.

p12tic avatar Jun 22 '24 16:06 p12tic