verify: config is encoded in utf8; cwd is absolute path; env is valid#70
Merged
mrunalp merged 2 commits intoopencontainers:masterfrom May 20, 2016
Merged
verify: config is encoded in utf8; cwd is absolute path; env is valid#70mrunalp merged 2 commits intoopencontainers:masterfrom
mrunalp merged 2 commits intoopencontainers:masterfrom
Conversation
Signed-off-by: liang chenye <liangchenye@huawei.com>
Member
Author
|
|
||
| func checkProcess(process rspec.Process, rootfs string) { | ||
| if !path.IsAbs(process.Cwd) { | ||
| logrus.Fatalf("Cwd '%s' is not an absolute path", process.Cwd) |
Contributor
There was a problem hiding this comment.
you can use %q instead of '%s'
Member
Author
|
Thanks @mrunalp , updated. |
| defer sf.Close() | ||
|
|
||
| if !utf8.Valid(content) { | ||
| logrus.Fatalf("'Config.json' is not encoded in UTF-8") |
Contributor
There was a problem hiding this comment.
Config.json → config.json for folks on case-sensitive filesystems?
Contributor
There was a problem hiding this comment.
Actually, maybe store the path.Join in a variable, and pass that variable to both ReadFile and this error message.
225565a to
664508c
Compare
Member
Author
| logrus.Fatalf("Cannot find the mount destination %q", rootfsPath) | ||
| } else if !fi.IsDir() { | ||
| logrus.Fatalf("Mount point: %v is not a directory.", rootfsPath) | ||
| logrus.Fatalf("Mount destination %q is not a directory.", rootfsPath) |
Contributor
There was a problem hiding this comment.
It predates this PR, but rootfsPath is a strange name for a variable holding the mount destination.
Signed-off-by: liang chenye <liangchenye@huawei.com>
Member
Author
|
@wking renamed |
Contributor
Contributor
|
LGTM |
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.
fix #67
Signed-off-by: liang chenye liangchenye@huawei.com