update nfs driver for kube 1.14
This commit is contained in:
parent
f55eb4f5cb
commit
959bfe4201
23
pkg/nfs/controllerserver.go
Normal file
23
pkg/nfs/controllerserver.go
Normal file
@ -0,0 +1,23 @@
|
||||
package nfs
|
||||
|
||||
import (
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
"github.com/kubernetes-csi/drivers/pkg/csi-common"
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type ControllerServer struct {
|
||||
*csicommon.DefaultControllerServer
|
||||
}
|
||||
|
||||
func (cs ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "")
|
||||
}
|
||||
|
||||
func getControllerServer(csiDriver *csicommon.CSIDriver) ControllerServer {
|
||||
return ControllerServer{
|
||||
csicommon.NewDefaultControllerServer(csiDriver),
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,7 @@ func (d *driver) Run() {
|
||||
csicommon.NewDefaultIdentityServer(d.csiDriver),
|
||||
// NFS plugin has not implemented ControllerServer
|
||||
// using default controllerserver.
|
||||
csicommon.NewDefaultControllerServer(d.csiDriver),
|
||||
getControllerServer(d.csiDriver),
|
||||
NewNodeServer(d))
|
||||
s.Wait()
|
||||
}
|
||||
|
||||
@ -22,13 +22,11 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
"github.com/kubernetes-csi/drivers/pkg/csi-common"
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
"k8s.io/kubernetes/pkg/volume/util"
|
||||
|
||||
"github.com/kubernetes-csi/drivers/pkg/csi-common"
|
||||
)
|
||||
|
||||
type nodeServer struct {
|
||||
@ -92,7 +90,7 @@ func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
|
||||
return nil, status.Error(codes.NotFound, "Volume not mounted")
|
||||
}
|
||||
|
||||
err = util.UnmountPath(req.GetTargetPath(), mount.New(""))
|
||||
err = mount.CleanupMountPoint(req.GetTargetPath(), mount.New(""), false)
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
@ -107,3 +105,7 @@ func (ns *nodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag
|
||||
func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
|
||||
return &csi.NodeStageVolumeResponse{}, nil
|
||||
}
|
||||
|
||||
func (ns *nodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user