cnabio / cnab-go

A Go implementation of CNAB Core 1.0
MIT License
69 stars 37 forks source link

Runtime should default missing output files #122

Closed carolynvs closed 5 years ago

carolynvs commented 5 years ago

A last minute spec clarification was put in that affects the runtime implementation in cnab-go. https://github.com/deislabs/cnab-spec/pull/270

All outputs that apply to a specified action are considered to be required. If an output is missing at the end of an action, and a default is defined, the runtime should write the default to the file specified by the path attribute. Otherwise the runtime should report the missing output as an error to the user.

Right now we expect all outputs to exist when we fetch them and return an error when one doesn't exist. The change needed is to detect when the output file is missing, and to create it with the default defined on the output, if specified.