Skip to content
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

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

Mashimiao
Copy link

Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com

@liangchenye
Copy link
Member

liangchenye commented Jan 17, 2017

LGTM

Approved with PullApprove

}
absPath := filepath.Join(rootfsPath, process.Args[0])
if _, err := os.Stat(absPath); err != nil {
msgs = append(msgs, err.Error())
Copy link
Contributor

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).

@Mashimiao
Copy link
Author

@wking @liangchenye @mrunalp @hqhq PTAL

absPath := filepath.Join(rootfsPath, process.Args[0])
fileinfo, err := os.Stat(absPath)
if err != nil {
if !os.IsNotExist(err) {
Copy link
Contributor

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 {
  …
}

Copy link
Author

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>
@Mashimiao
Copy link
Author

@wking @liangchenye @mrunalp @hqhq PTAL

@wking
Copy link
Contributor

wking commented Jan 18, 2017 via email

@mrunalp
Copy link
Contributor

mrunalp commented Jan 27, 2017

LGTM

Approved with PullApprove

1 similar comment
@hqhq
Copy link
Contributor

hqhq commented Feb 8, 2017

LGTM

Approved with PullApprove

@hqhq hqhq merged commit 671883e into opencontainers:master Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants