-
Notifications
You must be signed in to change notification settings - Fork 141
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: modify the validation of mounts.type #397
base: master
Are you sure you want to change the base?
Conversation
validate/validate.go
Outdated
} else if OS == "windows" { | ||
supportedTypes["ntfs"] = true | ||
} else if OS == "solaris" { | ||
supportedTypes["lofs"] = true |
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.
On the type
of solaris
support, I found the following sentence in the relevant documents:
Used to specify the FSType on which to operate. The FSType must be specified or must be determinable from /etc/vfstab, or by consulting /etc/default/fs or /etc/dfs/fstypes.
But I did not find these documents, only given examples given a support 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.
This is not correct modification. You can refer to FSTYPE in mount(1) to determine solaris supports fs types.
Windows does not support type in mount, there is no need to output warning and we should accept this change after spec v1.0 released.
validate/validate.go
Outdated
@@ -337,11 +337,31 @@ func (v *Validator) CheckRlimits() (msgs []string) { | |||
func supportedMountTypes(OS string, hostSpecific bool) (map[string]bool, error) { | |||
supportedTypes := make(map[string]bool) | |||
|
|||
if OS != "linux" && OS != "windows" { | |||
if OS != "linux" && OS != "solaris" { | |||
logrus.Warnf("%v is not supported to check mount type", OS) |
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.
Repeating @Mashimiao's earlier comment, since it still applies:
Windows does not support type in mount, there is no need to output warning and we should accept this change after spec v1.0 released.
type
is not defined for Windows since opencontainers/runtime-spec#854 (which you site in the comment opening this PR). So configs which set it are taking advantage of the extensibility rules that allow them to do so. Individual runtimes may or may not act upon the extention, but it's still a valid config.
There may be users who are interested in knowing if a runtime MUST support a given config (e.g. if that config can be portably used with any OCI-compliant runtime). In that case, we would want to warn/error when we found extentions like this. More thoughts on that sort of thing in opencontainers/image-tools#66. However, neither runtime-tools nor image-tools currently provides switches for that sort of thing, so for the time being I'd rather silently ignore the type
value (if any) in Windows configs.
Signed-off-by: zhouhao <[email protected]>
7d3cf4d
to
9e97695
Compare
I‘m not familiar with solaris system, so I'm not sure if this is a right validation. But from here, It seems vfstab stores default mounted file systems not all supported file systems. |
It's a validation about solaris but we are not familiar with it, at least I@liangchenye and I. We can't make sure whether it's right or not just from solaris's reference document. And I think we should perfect Linux related validations first. Other platform's may be later. |
According to this PR revision.
Signed-off-by: zhouhao [email protected]