{"action":"created","issue":{"url":"https://api.github.com/repos/docker/libcompose/issues/185","repository_url":"https://api.github.com/repos/docker/libcompose","labels_url":"https://api.github.com/repos/docker/libcompose/issues/185/labels{/name}","comments_url":"https://api.github.com/repos/docker/libcompose/issues/185/comments","events_url":"https://api.github.com/repos/docker/libcompose/issues/185/events","html_url":"https://github.com/docker/libcompose/issues/185","id":144124059,"number":185,"title":"Using extends I got duplicated env variables in the env hash","user":{"login":"awsmsrc","id":994907,"avatar_url":"https://avatars.githubusercontent.com/u/994907?v=3","gravatar_id":"","url":"https://api.github.com/users/awsmsrc","html_url":"https://github.com/awsmsrc","followers_url":"https://api.github.com/users/awsmsrc/followers","following_url":"https://api.github.com/users/awsmsrc/following{/other_user}","gists_url":"https://api.github.com/users/awsmsrc/gists{/gist_id}","starred_url":"https://api.github.com/users/awsmsrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awsmsrc/subscriptions","organizations_url":"https://api.github.com/users/awsmsrc/orgs","repos_url":"https://api.github.com/users/awsmsrc/repos","events_url":"https://api.github.com/users/awsmsrc/events{/privacy}","received_events_url":"https://api.github.com/users/awsmsrc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/libcompose/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/libcompose/milestones/3","html_url":"https://github.com/docker/libcompose/milestones/0.2.0%20Trusting%20Euler","labels_url":"https://api.github.com/repos/docker/libcompose/milestones/3/labels","id":1510522,"number":3,"title":"0.2.0 Trusting Euler","description":"https://github.com/docker/libcompose/wiki/0.2.0-Milestone-Project-Page","creator":{"login":"vdemeester","id":6508,"avatar_url":"https://avatars.githubusercontent.com/u/6508?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":13,"state":"open","created_at":"2016-01-16T21:35:15Z","updated_at":"2016-04-02T17:04:40Z","due_on":"2016-04-13T22:00:00Z","closed_at":null},"comments":8,"created_at":"2016-03-29T01:01:23Z","updated_at":"2016-04-02T18:16:50Z","closed_at":null,"body":"Hey folks,\r\n\r\nreally looking forward to using libcompose. I noticed one issue whereby env variables were duplicated incorrectly in the env hash when using extends. This case also seems to be missing from merge_test.go.\r\n\r\nWould love to look into it further but I'm a little busy right now so i provided my test program in case any one wants to repro and look into it\r\n\r\nbase.yml\r\n```\r\nweb:\r\n  image: ubuntu\r\n  evironment:\r\n    - FOO=BAR\r\n```\r\n\r\ndocker-compose.yml\r\n```\r\nweb:\r\n  extends: ./base.yml\r\n  image: ubuntu\r\n  links:\r\n    - redis\r\n  environment:\r\n    - COMPUTERS=COOL\r\n\r\nredis:\r\n  image: redis\r\n```\r\n\r\ntest program\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\r\n\t\"github.com/docker/libcompose/docker\"\r\n\t\"github.com/docker/libcompose/project\"\r\n)\r\n\r\nfunc main() {\r\n\tproject, err := docker.NewProject(&docker.Context{\r\n\t\tContext: project.Context{\r\n\t\t\tComposeFiles: []string{\"docker-compose.yml\"},\r\n\t\t\tProjectName:  \"my-compose\",\r\n\t\t},\r\n\t})\r\n\r\n\tif err != nil {\r\n\t\tfmt.Println(err.Error())\r\n\t\treturn\r\n\t}\r\n\r\n\terr = project.Parse()\r\n\tif err != nil {\r\n\t\tfmt.Println(err.Error())\r\n\t\treturn\r\n\t}\r\n\r\n\tfor _, c := range project.Configs {\r\n\t\tfmt.Printf(\"%#v\\n\", c)\r\n\t\tfmt.Printf(\"%#v\\n\", c.Environment)\r\n\t}\r\n\r\n}\r\n```\r\n\r\noutput\r\n```\r\n&project.ServiceConfig{Build:\"\", CapAdd:[]string(nil), CapDrop:[]string(nil), CgroupParent:\"\", CPUQuota:0, CPUSet:\"\", CPUShares:0, Command:project.Command{parts:[]string(nil)}, ContainerName:\"\", Devices:[]string(nil), DNS:project.Stringorslice{parts:[]string(nil)}, DNSSearch:project.Stringorslice{parts:[]string(nil)}, Dockerfile:\"\", DomainName:\"\", Entrypoint:project.Command{parts:[]string(nil)}, EnvFile:project.Stringorslice{parts:[]string(nil)}, Environment:project.MaporEqualSlice{parts:[]string(nil)}, Hostname:\"\", Image:\"redis\", Labels:project.SliceorMap{parts:map[string]string{}}, Links:project.MaporColonSlice{parts:[]string(nil)}, LogDriver:\"\", MacAddress:\"\", MemLimit:0, MemSwapLimit:0, Name:\"\", Net:\"\", Pid:\"\", Uts:\"\", Ipc:\"\", Ports:[]string(nil), Privileged:false, Restart:\"\", ReadOnly:false, StdinOpen:false, SecurityOpt:[]string(nil), Tty:false, User:\"\", VolumeDriver:\"\", Volumes:[]string(nil), VolumesFrom:[]string(nil), WorkingDir:\"\", Expose:[]string(nil), ExternalLinks:[]string(nil), LogOpt:map[string]string(nil), ExtraHosts:[]string(nil), Ulimits:project.Ulimits{Elements:[]project.Ulimit(nil)}}\r\nproject.MaporEqualSlice{parts:[]string(nil)}\r\n&project.ServiceConfig{Build:\"\", CapAdd:[]string(nil), CapDrop:[]string(nil), CgroupParent:\"\", CPUQuota:0, CPUSet:\"\", CPUShares:0, Command:project.Command{parts:[]string(nil)}, ContainerName:\"\", Devices:[]string(nil), DNS:project.Stringorslice{parts:[]string(nil)}, DNSSearch:project.Stringorslice{parts:[]string(nil)}, Dockerfile:\"\", DomainName:\"\", Entrypoint:project.Command{parts:[]string(nil)}, EnvFile:project.Stringorslice{parts:[]string(nil)}, Environment:project.MaporEqualSlice{parts:[]string{\"COMPUTERS=COOL\", \"COMPUTERS=COOL\"}}, Hostname:\"\", Image:\"ubuntu\", Labels:project.SliceorMap{parts:map[string]string{}}, Links:project.MaporColonSlice{parts:[]string{\"redis\", \"redis\"}}, LogDriver:\"\", MacAddress:\"\", MemLimit:0, MemSwapLimit:0, Name:\"\", Net:\"\", Pid:\"\", Uts:\"\", Ipc:\"\", Ports:[]string(nil), Privileged:false, Restart:\"\", ReadOnly:false, StdinOpen:false, SecurityOpt:[]string(nil), Tty:false, User:\"\", VolumeDriver:\"\", Volumes:[]string(nil), VolumesFrom:[]string(nil), WorkingDir:\"\", Expose:[]string(nil), ExternalLinks:[]string(nil), LogOpt:map[string]string(nil), ExtraHosts:[]string(nil), Ulimits:project.Ulimits{Elements:[]project.Ulimit(nil)}}\r\nproject.MaporEqualSlice{parts:[]string{\"COMPUTERS=COOL\", \"COMPUTERS=COOL\"}}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/docker/libcompose/issues/comments/204768915","html_url":"https://github.com/docker/libcompose/issues/185#issuecomment-204768915","issue_url":"https://api.github.com/repos/docker/libcompose/issues/185","id":204768915,"user":{"login":"awsmsrc","id":994907,"avatar_url":"https://avatars.githubusercontent.com/u/994907?v=3","gravatar_id":"","url":"https://api.github.com/users/awsmsrc","html_url":"https://github.com/awsmsrc","followers_url":"https://api.github.com/users/awsmsrc/followers","following_url":"https://api.github.com/users/awsmsrc/following{/other_user}","gists_url":"https://api.github.com/users/awsmsrc/gists{/gist_id}","starred_url":"https://api.github.com/users/awsmsrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awsmsrc/subscriptions","organizations_url":"https://api.github.com/users/awsmsrc/orgs","repos_url":"https://api.github.com/users/awsmsrc/repos","events_url":"https://api.github.com/users/awsmsrc/events{/privacy}","received_events_url":"https://api.github.com/users/awsmsrc/received_events","type":"User","site_admin":false},"created_at":"2016-04-02T18:16:50Z","updated_at":"2016-04-02T18:16:50Z","body":"![image](https://cloud.githubusercontent.com/assets/994907/14228242/6312a946-f8c4-11e5-9f9b-52db06024e5b.png)\r\n\r\nRight you are, in that case there should probably be some error handling there?"}}