Skip to content

Commit 75e7fe7

Browse files
author
Mathusan Selvarajah
committed
update nfs driver for kube 1.14
1 parent 892c7a8 commit 75e7fe7

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

pkg/nfs/controllerserver.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package nfs
2+
3+
import (
4+
"github.com/container-storage-interface/spec/lib/go/csi"
5+
"github.com/kubernetes-csi/drivers/pkg/csi-common"
6+
"golang.org/x/net/context"
7+
"google.golang.org/grpc/codes"
8+
"google.golang.org/grpc/status"
9+
)
10+
11+
type ControllerServer struct {
12+
*csicommon.DefaultControllerServer
13+
}
14+
15+
func (cs ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
16+
return nil, status.Error(codes.Unimplemented, "")
17+
}
18+
19+
func getControllerServer(csiDriver *csicommon.CSIDriver) ControllerServer {
20+
return ControllerServer{
21+
csicommon.NewDefaultControllerServer(csiDriver),
22+
}
23+
}

pkg/nfs/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (d *driver) Run() {
7272
csicommon.NewDefaultIdentityServer(d.csiDriver),
7373
// NFS plugin has not implemented ControllerServer
7474
// using default controllerserver.
75-
csicommon.NewDefaultControllerServer(d.csiDriver),
75+
getControllerServer(d.csiDriver),
7676
NewNodeServer(d))
7777
s.Wait()
7878
}

pkg/nfs/nodeserver.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ import (
2222
"strings"
2323

2424
"github.com/container-storage-interface/spec/lib/go/csi"
25+
"github.com/kubernetes-csi/drivers/pkg/csi-common"
2526
"golang.org/x/net/context"
2627
"google.golang.org/grpc/codes"
2728
"google.golang.org/grpc/status"
2829
"k8s.io/kubernetes/pkg/util/mount"
29-
"k8s.io/kubernetes/pkg/volume/util"
30-
31-
"github.com/kubernetes-csi/drivers/pkg/csi-common"
3230
)
3331

3432
type nodeServer struct {
@@ -92,7 +90,7 @@ func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
9290
return nil, status.Error(codes.NotFound, "Volume not mounted")
9391
}
9492

95-
err = util.UnmountPath(req.GetTargetPath(), mount.New(""))
93+
err = mount.CleanupMountPoint(req.GetTargetPath(), mount.New(""), false)
9694
if err != nil {
9795
return nil, status.Error(codes.Internal, err.Error())
9896
}
@@ -107,3 +105,7 @@ func (ns *nodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag
107105
func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
108106
return &csi.NodeStageVolumeResponse{}, nil
109107
}
108+
109+
func (ns *nodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
110+
return nil, status.Error(codes.Unimplemented, "")
111+
}

0 commit comments

Comments
 (0)