-
Notifications
You must be signed in to change notification settings - Fork 587
Description
In opencontainers/image-spec#87, @philips is wondering whether the runtime-spec maintainers think network configuration and other metadata should go in config.json's annotations or in an external file. That sounds like something that deserves a SHOULD suggestion in this spec, so folks who don't already have an opinion can follow whatever the best practice is deemed to be without having to think to hard.
Besides the labels/annotation work in this repository with #188, #331, and #480, there was also some IRC discussion recorded here, with me arguing for external files and @vbatts arguing for embedding in config.json. More recently, @julz floated an external hooks.json (and @mrunalp came right back and suggested annotations). So possible OCI positions:
We really don't care
Language (in the annotations
docs?) like:
Opaque metadata MAY also be stored in external files, and this specification makes no recommendation on whether to use external files or
annotations
.
Recommend external files for everything
Language like:
Information that does not target the OCI runtime implementation SHOULD be stored in separate files alongside the runtime's
config.json
.
This is my current preference, since it means the runtime is obviously not responsible for anything related to the extra data. But it means that having annotations
in the config.json spec at all will be a bit confusing (I'd prefer removing it).
Recommend annotations for everything
Language like:
Information that does not target the OCI runtime implementation SHOULD be stored in
annotations
. Information that is structured should be flattened to a string, since theannotations
map requires string values.
If we lift the string requirement and allow opaque data in annotations
, we could drop the second sentence.
Recommend annotations for string data, and external files for structured data
Language like:
Information that does not target the OCI runtime implementation SHOULD be stored in
annotation
if it can be represented as a string without difficulty. Information that is more structured (e.g. JSON objects) SHOULD be stored in external files alongside the runtime'sconfig.json
.
Other ideas?
Are there breakdowns I'm missing? It's hard to say much about opaque data. And while @philips clearly has expectations about [downstream consumption of the image-spec annotations][6], I'm not sure how generic those expectations are (and maybe he doesn't think they apply to the runtime-spec's annotations
anyway).