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 the verification content #327

Merged
merged 1 commit into from
Mar 8, 2017

Conversation

zhouhao3
Copy link

@zhouhao3 zhouhao3 commented Feb 20, 2017

According to this.

Signed-off-by: zhouhao zhouhao@cn.fujitsu.com

@zhouhao3 zhouhao3 changed the title validate: add rlimits's type judgment validate: add the verification content Feb 20, 2017
Copy link
Contributor

@wking wking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be work in flight for the rlimit type check too, but I couldn't turn one up with a quick grep.

if v.spec.Linux.Devices[index].Type == v.spec.Linux.Devices[i].Type &&
v.spec.Linux.Devices[index].Major == v.spec.Linux.Devices[i].Major &&
v.spec.Linux.Devices[index].Minor == v.spec.Linux.Devices[i].Minor {
fmt.Println("WARNING: The same type, major and minor should not be used for multiple devices.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check duplicates some work in flight with #297.

@@ -257,6 +257,11 @@ func (v *Validator) CheckProcess() (msgs []string) {
if process.Rlimits[index].Hard < process.Rlimits[index].Soft {
msgs = append(msgs, fmt.Sprintf("hard limit of rlimit %s should not be less than soft limit.", process.Rlimits[index].Type))
}
for i := index + 1; i < len(process.Rlimits); i++ {
if strings.EqualFold(process.Rlimits[index].Type, process.Rlimits[i].Type) {
Copy link

@Mashimiao Mashimiao Feb 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to use EqualFold, just == is fine

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
@Mashimiao
Copy link

Mashimiao commented Feb 21, 2017

LGTM

Approved with PullApprove

@zhouhao3
Copy link
Author

@mrunalp @liangchenye PTAL

@liangchenye
Copy link
Member

liangchenye commented Mar 8, 2017

LGTM

Approved with PullApprove

@liangchenye liangchenye merged commit 8392e59 into opencontainers:master Mar 8, 2017
@zhouhao3 zhouhao3 deleted the rlmit-valide branch March 9, 2017 02:10
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.

4 participants