-
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
validate: add the verification content #327
Conversation
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.
There may be work in flight for the rlimit type check too, but I couldn't turn one up with a quick grep.
validate/validate.go
Outdated
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.") |
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.
This check duplicates some work in flight with #297.
1b31170
to
421f08f
Compare
validate/validate.go
Outdated
@@ -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) { |
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.
There is no need to use EqualFold, just ==
is fine
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.
updated
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
421f08f
to
f40b202
Compare
@mrunalp @liangchenye PTAL |
According to this.
Signed-off-by: zhouhao zhouhao@cn.fujitsu.com