mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Move nsenter mounter to pkg/volume/util/nsenter
As part of moving pkg/util/mount out of tree, the NSEnter implementation of mount.Interface needs to be relocated out of pkg/util/mount, as it is K8s specific. This patch relocates that mounter implementation to pkg/volume/util/nsenter. Since the NSEnter mounter shares a lot of its logic with the Linux mounter implementation, many of the previously private methods of the Linux mounter are now made public to maintain that shared code. Additionaly, it was observed that *all* mount.Interface implemenations were using the same common method for IsNotMountPoint, so this patch removes that method from the mount.Interface definition and just exports the common implementation instead.
This commit is contained in:
@@ -108,6 +108,7 @@ go_library(
|
||||
"//pkg/volume/scaleio:go_default_library",
|
||||
"//pkg/volume/secret:go_default_library",
|
||||
"//pkg/volume/storageos:go_default_library",
|
||||
"//pkg/volume/util/nsenter:go_default_library",
|
||||
"//pkg/volume/util/subpath:go_default_library",
|
||||
"//pkg/volume/vsphere_volume:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
|
@@ -96,6 +96,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/util/rlimit"
|
||||
"k8s.io/kubernetes/pkg/version"
|
||||
"k8s.io/kubernetes/pkg/version/verflag"
|
||||
nsutil "k8s.io/kubernetes/pkg/volume/util/nsenter"
|
||||
"k8s.io/kubernetes/pkg/volume/util/subpath"
|
||||
"k8s.io/utils/exec"
|
||||
"k8s.io/utils/nsenter"
|
||||
@@ -373,7 +374,7 @@ func UnsecuredDependencies(s *options.KubeletServer) (*kubelet.Dependencies, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mounter = mount.NewNsenterMounter(s.RootDirectory, ne)
|
||||
mounter = nsutil.NewNsenterMounter(s.RootDirectory, ne)
|
||||
// NSenter only valid on Linux
|
||||
subpather = subpath.NewNSEnter(mounter, ne, s.RootDirectory)
|
||||
// an exec interface which can use nsenter for flex plugin calls
|
||||
|
Reference in New Issue
Block a user