{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/2953","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/2953/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/2953/comments","events_url":"https://api.github.com/repos/docker/compose/issues/2953/events","html_url":"https://github.com/docker/compose/pull/2953","id":134533577,"number":2953,"title":"Enable interpolation of keys in compose file","user":{"login":"dvaergiller","id":584366,"avatar_url":"https://avatars.githubusercontent.com/u/584366?v=3","gravatar_id":"","url":"https://api.github.com/users/dvaergiller","html_url":"https://github.com/dvaergiller","followers_url":"https://api.github.com/users/dvaergiller/followers","following_url":"https://api.github.com/users/dvaergiller/following{/other_user}","gists_url":"https://api.github.com/users/dvaergiller/gists{/gist_id}","starred_url":"https://api.github.com/users/dvaergiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvaergiller/subscriptions","organizations_url":"https://api.github.com/users/dvaergiller/orgs","repos_url":"https://api.github.com/users/dvaergiller/repos","events_url":"https://api.github.com/users/dvaergiller/events{/privacy}","received_events_url":"https://api.github.com/users/dvaergiller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/compose/labels/area/config","name":"area/config","color":"c7def8"},{"url":"https://api.github.com/repos/docker/compose/labels/kind/enhancement","name":"kind/enhancement","color":"5319e7"},{"url":"https://api.github.com/repos/docker/compose/labels/status/0-triage","name":"status/0-triage","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-18T10:02:54Z","updated_at":"2016-02-18T21:26:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/compose/pulls/2953","html_url":"https://github.com/docker/compose/pull/2953","diff_url":"https://github.com/docker/compose/pull/2953.diff","patch_url":"https://github.com/docker/compose/pull/2953.patch"},"body":"This adds interpolation of all keys in the compose file except the\r\nsections themselves. I have a need for doing that when, for example,\r\ncreating overlay networks based on some unique name:\r\n\r\n```\r\nnetworks:\r\n  ${NAMESPACE}_overlay:\r\n     driver: overlay\r\n\r\nservices:\r\n  my_service:\r\n    networks:\r\n      - \"${NAMESPACE}_overlay\"\r\n```\r\n\r\nThe reason for the slight code restructuring was to avoid code\r\nduplication when implementing this. I do welcome feedback."},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/185929793","html_url":"https://github.com/docker/compose/pull/2953#issuecomment-185929793","issue_url":"https://api.github.com/repos/docker/compose/issues/2953","id":185929793,"user":{"login":"dnephin","id":442180,"avatar_url":"https://avatars.githubusercontent.com/u/442180?v=3","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T21:26:16Z","updated_at":"2016-02-18T21:26:16Z","body":"Could you explain a bit more why it's necessary to use a variable for the network name?  You could always make the network external, and then you would only need to put a variable in the `name:` field, which would work as-is."}}