Error Reference cannot tell the specific line on the spec
Now, we can only tell the markdown place. For some config items which include several 'MUST/SHOULD', it might be difficult for user to find out the detailed error.
Original discussion is from https://github.com/opencontainers/runtime-tools/pull/451.
for _, hook := range hooks {
if !filepath.IsAbs(hook.Path) {
- msgs = append(msgs, fmt.Sprintf("The %s hook %v: is not absolute path", hookType, hook.Path))
+ errs = multierror.Append(errs, fmt.Errorf("The %s hook %v: is not absolute path", hookType, hook.Path))
}
}
The MUST for this check is here. For poststart and poststop the requirement is indirect, via this and this. Perhaps we should expand Error.Reference to an array of strings so we can represent trails like that? Although if we're sticking to Markdown links, this is as specific as we can get at the moment, and it covers all the lines I linked earlier.
On Wed, Aug 30, 2017 at 03:20:55AM +0000, 梁辰晔 (Liang Chenye) wrote:
Now, we can only tell the markdown place. For some config items which include several 'MUST/SHOULD', it might be difficult for user to find out the detailed error.
This is really an argument to re-open opencontainers/runtime-spec#634, which I'd requested last month 1. It's not a runtime-tools issue, it's a runtime-spec issue.
On Wed, Aug 30, 2017 at 03:22:59AM +0000, 梁辰晔 (Liang Chenye) wrote:
For poststart and poststop the requirement is indirect, via this and this. Perhaps we should expand Error.Reference to an array of strings so we can represent trails like that?
This is the runtime-tools issue I was trying to get at. An example that is completely separate from opencontainers/runtime-spec#634 is the environment-variable check 2, where the violated requirement is in POSIX which is included via a spec condition. I think there are a few checks like that where the violation requires references to several locations, and to support those we'd want:
References []string
instead of our current 3:
Reference string