Uh oh!
There was an error while loading. Please reload this page.
validate: add Hooks validation - #49
Conversation
| } | ||
| } | ||
| func checkHooks(process rspec.Hooks, rootfs string) { |
There was a problem hiding this comment.
process is a strange name for this variable. How about hooks? And hooks are in the host mount namespace, so I don't think we need rootfs.
There was a problem hiding this comment.
@wking change process to hooks is fine.hooks are in the host mount namespace I'm not sure what it means.
Do you mean hooks is not in OCI bundle?
There was a problem hiding this comment.
On Thu, Apr 28, 2016 at 07:54:26PM -0700, Ma Shimiao wrote:
hooks are in the host mount namespaceI'm not sure what it means.
Do you mean hooks is not in OCI bundle?
The may be in the bundle, but if they are, the path will be
/path/to/bundle/and/hook, not /and/hook. Specs are 1:
“Hook paths are absolute and are executed from the host's
filesystem.”
Although I'd be happier if the wording used “runtime namespace” 2 so
it was explicit about other namespaces as well (e.g. hooks are also in
the host network namepace, the host ipc namespace, …).
wking
commented
Apr 28, 2016
This sort of validation would be easier if we could recycle the |
0daf264 to
1910466Compareliangchenye
commented
May 3, 2016
Thanks @Mashimiao, Also, since the hook command exists in the host's filesystem, we can not check that in bundle validation.go. (But we reuse this code in runtime test.) |
wking
commented
May 3, 2016
On Tue, May 03, 2016 at 02:36:04AM -0700, 梁辰晔 (Liang Chenye) wrote:
We can check “Does the hook command exist in the host's filesystem?”, |
4b3b29e to
6ed1bd2CompareMashimiao
commented
May 9, 2016
@wking@liangchenye |
liangchenye
commented
May 9, 2016
The hook configuration is a little tricky, it is not portable. |
6ed1bd2 to
29a4d8eCompareMashimiao
commented
May 10, 2016
@wking@liangchenye PR updated |
| Path to bundle | ||
| **--hooks-check** | ||
| Specify check hooks on host, default is false. |
There was a problem hiding this comment.
I'd have gone with --hook-paths or some such, but I expect folks will get the idea regardless. It's probably worth detailing what the hook checks are and why this is optional. The only check that needs to be toggle-able is “Does the path exist (and point to an executable)?”, and there is other validation that you can do beyond that (e.g. “Are there equals signs in all the env values?”).
52bc38a to
028d996CompareMashimiao
commented
May 16, 2016
ping @liangchenye |
| **ocitools validate** *[OPTIONS]* | ||
| [**--help**] | ||
| [**--path**[=*PATH*] | ||
| [**--hooks-check**[=*true*|*false*] |
There was a problem hiding this comment.
Listing specific options here rolls back part of c1df0ce (Fixup man pages for consistency, 2016-05-07, #65). I like the shorter [OPTIONS] for generate (see #42) because it has lots of options. I don't care either way for validate, but we probably want to pick one approach and not flip back and forth without motivation ;).
c71d294 to
f54700dCompareliangchenye
commented
May 17, 2016
Thanks @Mashimiao LGTM |
wking
commented
May 17, 2016
via email
Ah, I'd missed the responses to my earlier comments. f54700d looks
good to me too. |
Mashimiao
commented
May 19, 2016
ping @mrunalp |
Hi @Mashimiao, |
@liangchenye OK, I can implement it in this PR. |
f54700d to
51d1cc6Comparewking
commented
May 20, 2016
via email
51d1cc6 still looks good to me. |
wking
commented
May 20, 2016
51d1cc6 to
ce49f78CompareMashimiao
commented
May 20, 2016
@wking Ah, yes. I did not read @liangchenye 's words carefully. How about now? |
wking
commented
May 20, 2016
On Fri, May 20, 2016 at 01:30:20AM -0700, Ma Shimiao wrote:
ce49f78 looks great :). |
| Path to bundle | ||
| **--hooks** | ||
| Specify check hooks exists and executable on host, default is false. |
There was a problem hiding this comment.
nit: Check specified hooks exist and are executable on the host.
ce49f78 to
f11bccfCompare| var bundleValidateFlags = []cli.Flag{ | ||
| cli.StringFlag{Name: "path", Usage: "path to a bundle"}, | ||
| cli.BoolFlag{Name: "hooks", Usage: "Specify check hooks on host, default is false"}, |
There was a problem hiding this comment.
Can you change it here as well? Thanks!
f11bccf to
8f62787Comparemrunalp
commented
May 24, 2016
Needs rebase |
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
8f62787 to
d5f4bb2CompareMashimiao
commented
May 24, 2016
@mrunalp rebased. |
mrunalp
commented
May 24, 2016
LGTM |
Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com