-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
verify: config is encoded in utf8; cwd is absolute path; env is valid #70
Conversation
Signed-off-by: liang chenye <[email protected]>
@@ -129,16 +132,26 @@ func checkPlatform(platform rspec.Platform) { | |||
} | |||
|
|||
func checkProcess(process rspec.Process, rootfs string) { | |||
if !path.IsAbs(process.Cwd) { | |||
logrus.Fatalf("Cwd '%s' is not an absolute path", process.Cwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use %q instead of '%s'
Thanks @mrunalp , updated. |
defer sf.Close() | ||
|
||
if !utf8.Valid(content) { | ||
logrus.Fatalf("'Config.json' is not encoded in UTF-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Config.json
→ config.json
for folks on case-sensitive filesystems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, maybe store the path.Join
in a variable, and pass that variable to both ReadFile
and this error message.
225565a
to
664508c
Compare
} else if !fi.IsDir() { | ||
logrus.Fatalf("Mount point: %v is not a directory.", rootfsPath) | ||
logrus.Fatalf("Mount destination %q is not a directory.", rootfsPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It predates this PR, but rootfsPath
is a strange name for a variable holding the mount destination.
Signed-off-by: liang chenye <[email protected]>
@wking renamed |
LGTM |
fix #67
Signed-off-by: liang chenye [email protected]