Expose MountedByOpenat2 as a public function so that k8s can consume#96
Expose MountedByOpenat2 as a public function so that k8s can consume#96manugupt1 wants to merge 1 commit intomoby:masterfrom
Conversation
…nsumers can consume it Signed-off-by: Manu Gupta <[email protected]>
|
I think it's better to export something like 'MountedFast' which includes all the methods except for parsing mountinfo. I'll create the PR. |
OK, this is problematic, because there's no way to communicate back to the caller if we're sure this is not a mount point. Unless we do something like this: func MountedFast(path string) (mounted, sure bool, err error)when |
That is something that will work to; my PR always falls back if the fast path cannot guarantee a mount-point. |
MountedFast is a method of detecting mount points really fast. It works for all kinds of mounts (incl. bind mounts) but requires a recent (v5.6+) Linux kernel. A mount-point check is guaranteed to be a mount-point or not only when sure is true. When sure is false, the caller needs to check for other methods (eg: parse /proc/mounts) to successfully determine if it is a mount-point. This has been motivated by kubernetes/kubernetes#105833 (comment) and moby#96 (comment)
MountedFast is a method of detecting mount points really fast. It works for all kinds of mounts (incl. bind mounts) but requires a recent (v5.6+) Linux kernel. A mount-point check is guaranteed to be a mount-point or not only when sure is true. When sure is false, the caller needs to check for other methods (eg: parse /proc/mounts) to successfully determine if it is a mount-point. This has been motivated by kubernetes/kubernetes#105833 (comment) and moby#96 (comment)
MountedFast is a method of detecting mount points really fast. It works for all kinds of mounts (incl. bind mounts) but requires a recent (v5.6+) Linux kernel. A mount-point check is guaranteed to be a mount-point or not only when sure is true. When sure is false, the caller needs to check for other methods (eg: parse /proc/mounts) to successfully determine if it is a mount-point. This has been motivated by kubernetes/kubernetes#105833 (comment) and moby#96 (comment)
MountedFast is a method of detecting mount points really fast. It works for all kinds of mounts (incl. bind mounts) but requires a recent (v5.6+) Linux kernel. A mount-point check is guaranteed to be a mount-point or not only when sure is true. When sure is false, the caller needs to check for other methods (eg: parse /proc/mounts) to successfully determine if it is a mount-point. This has been motivated by kubernetes/kubernetes#105833 (comment) and moby#96 (comment) Signed-off-by: Manu Gupta <[email protected]>
|
Closing in favor of #97 |
Expose MountedByOpenat2 as a public function so that k8s can consume
One of the alternatives suggested here is to expose MountedByOpenat2 as a public function
so that k8s can consume and rest of the downstream can also benefit from it.
kubernetes/kubernetes#105833 (comment)
cc @kolyshkin