-
Notifications
You must be signed in to change notification settings - Fork 142
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
validate: add args validation #301
Conversation
} | ||
absPath := filepath.Join(rootfsPath, process.Args[0]) | ||
if _, err := os.Stat(absPath); err != nil { | ||
msgs = append(msgs, err.Error()) |
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.
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
@wking @liangchenye @mrunalp @hqhq PTAL |
absPath := filepath.Join(rootfsPath, process.Args[0]) | ||
fileinfo, err := os.Stat(absPath) | ||
if err != nil { | ||
if !os.IsNotExist(err) { |
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.
nit: You can flatten this a bit with:
if os.IsNotExist(err) {
…
} else if err != nil {
…
} else {
…
}
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.
Fine.
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
3d4dbfe
to
113fd04
Compare
@wking @liangchenye @mrunalp @hqhq PTAL |
113fd04 looks fine to me.
|
Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com