validate: add args validation#301
Merged
hqhq merged 1 commit intoopencontainers:masterfrom Feb 8, 2017
Merged
Conversation
Member
wking
reviewed
Jan 17, 2017
| } | ||
| absPath := filepath.Join(rootfsPath, process.Args[0]) | ||
| if _, err := os.Stat(absPath); err != nil { | ||
| msgs = append(msgs, err.Error()) |
Contributor
There was a problem hiding this comment.
Not finding the binary in the root.path is not necessarily fatal. Perhaps a later mount or pre-start hook or some such was going to provide a binary at the configured path (previous discussion here).
2a29625 to
3d4dbfe
Compare
Author
|
@wking @liangchenye @mrunalp @hqhq PTAL |
wking
reviewed
Jan 17, 2017
| absPath := filepath.Join(rootfsPath, process.Args[0]) | ||
| fileinfo, err := os.Stat(absPath) | ||
| if err != nil { | ||
| if !os.IsNotExist(err) { |
Contributor
There was a problem hiding this comment.
nit: You can flatten this a bit with:
if os.IsNotExist(err) {
…
} else if err != nil {
…
} else {
…
}Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
3d4dbfe to
113fd04
Compare
Author
|
@wking @liangchenye @mrunalp @hqhq PTAL |
Contributor
|
113fd04 looks fine to me.
|
Contributor
1 similar comment
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com