Migrate from framwork.Logf and also use new nsenter interface

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2019-06-24 13:28:39 +05:30
committed by mergify[bot]
parent b3b181f2a5
commit 3bc6771df8
6 changed files with 41 additions and 36 deletions

View File

@ -160,7 +160,7 @@ func (ns *NodeServer) mountVolume(req *csi.NodePublishVolumeRequest, devicePath
func (ns *NodeServer) createTargetPath(targetPath string, isBlock bool) (bool, error) {
// Check if that target path exists properly
notMnt, err := ns.mounter.IsNotMountPoint(targetPath)
notMnt, err := mount.IsNotMountPoint(ns.mounter, targetPath)
if err != nil {
if os.IsNotExist(err) {
if isBlock {
@ -209,7 +209,7 @@ func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
}
}()
notMnt, err := ns.mounter.IsNotMountPoint(targetPath)
notMnt, err := mount.IsNotMountPoint(ns.mounter, targetPath)
if err != nil {
if os.IsNotExist(err) {
// targetPath has already been deleted

View File

@ -23,6 +23,7 @@ import (
"github.com/container-storage-interface/spec/lib/go/csi"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/util/mount"
nsutil "k8s.io/kubernetes/pkg/volume/util/nsenter"
"k8s.io/utils/exec"
"k8s.io/utils/nsenter"
)
@ -89,7 +90,7 @@ func NewNodeServer(d *csicommon.CSIDriver, containerized bool) (*NodeServer, err
if err != nil {
return nil, err
}
mounter = mount.NewNsenterMounter("", ne)
mounter = nsutil.NewMounter("", ne)
}
return &NodeServer{
DefaultNodeServer: csicommon.NewDefaultNodeServer(d),