Issue with env_file population.
cdrage opened this issue · 2 comments
Using this an example:
version: '2'
services:
redis:
image: 'bitnami/redis:latest'
environment:
- ALLOW_EMPTY_PASSWORD=no
env_file:
- foo.env
- bar.env
ports:
- '6379:6379'
It seems that env_file
isn't being properly populated to the ServiceConfig.
It's hard to explain without showing code, but essentially we use libcompose to parse a Docker Compose file and env_file
within ServiceConfig is blank.
Yes, it goes through the file and grabs the environment variables correctly, but within the libcompose code, env_file
isn't being shown within ServiceConfig (appears as a blank string).
I'll try to pull up an example later 👍
I just hit this as well. Was expecting the serviceConfig.EnvFile
field to be populated but it's empty even though the contents of the env files end up in serviceConfig.Environment
. Curious what the design intent was on this? I'd like to be able to determine which file a particular env var came from.
// ServiceConfig holds version 2 of libcompose service configuration
type ServiceConfig struct {
EnvFile yaml.Stringorslice `yaml:"env_file,omitempty"`
Environment yaml.MaporEqualSlice `yaml:"environment,omitempty"`
Looks like the culprit is here. @vdemeester do you know if we would break anyone if we simply removed this line? Any thoughts?