faradayio / cage

Develop and deploy complex Docker applications
http://cage.faraday.io
Apache License 2.0
307 stars 26 forks source link

Why are the pod.metadata.yml files separate from pod.yml files? #28

Closed rossmeissl closed 7 years ago

rossmeissl commented 7 years ago

@emk my naive opinion is that this is needless bureaucracy. But I'm guessing you have a reason. What is it?

emk commented 7 years ago

I really, really want to put the metadata in the pod files. But:

  1. The pod files are 100% standards-compliant docker-compose.yml files, parsed by a docker-compose.yml parser with no cage-specific enhancements. (This is, in my mind, a key design principle and a selling point.)
  2. The docker-compose.yml format has no support for per-file metadata, and in fact, the unit tests on docker-compose require it to fail if we add any custom metadata fields.

There are multiple upstream tracking issues about this. For example: https://github.com/docker/compose/issues/1655, https://github.com/docker/compose/issues/2578, https://github.com/docker/compose/issues/2684.

The ideal fix here is for Docker to fix one of those issues, for me to add the relevant support in compose_yml, and for *.metadata.yml to merge with *.yml. Failing that, if everybody but Docker could agree on a standard way of defining metadata, we could implement that and strip it out before passing it docker-compose. But I don't want to go my own way here without a standard or a consensus.

rossmeissl commented 7 years ago

@emk awesome, I knew you had a reason!