refactor csi-common and hostpath plugin for CSI 0.2.0 spec
This commit is contained in:
parent
ef2df731da
commit
aa9ec2da56
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package nfs
|
package nfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
"github.com/container-storage-interface/spec/lib/go/csi/v0"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
"github.com/kubernetes-csi/drivers/pkg/csi-common"
|
"github.com/kubernetes-csi/drivers/pkg/csi-common"
|
||||||
@ -39,23 +39,17 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version = csi.Version{
|
version = "0.2.0"
|
||||||
Minor: 1,
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetSupportedVersions() []*csi.Version {
|
|
||||||
return []*csi.Version{&version}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDriver(nodeID, endpoint string) *driver {
|
func NewDriver(nodeID, endpoint string) *driver {
|
||||||
glog.Infof("Driver: %v version: %v", driverName, csicommon.GetVersionString(&version))
|
glog.Infof("Driver: %v version: %v", driverName, version)
|
||||||
|
|
||||||
d := &driver{}
|
d := &driver{}
|
||||||
|
|
||||||
d.endpoint = endpoint
|
d.endpoint = endpoint
|
||||||
|
|
||||||
csiDriver := csicommon.NewCSIDriver(driverName, &version, GetSupportedVersions(), nodeID)
|
csiDriver := csicommon.NewCSIDriver(driverName, version, nodeID)
|
||||||
csiDriver.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{csi.VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER})
|
csiDriver.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{csi.VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER})
|
||||||
|
|
||||||
d.csiDriver = csiDriver
|
d.csiDriver = csiDriver
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
"github.com/container-storage-interface/spec/lib/go/csi/v0"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
@ -99,3 +99,11 @@ func (ns *nodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
|
|||||||
|
|
||||||
return &csi.NodeUnpublishVolumeResponse{}, nil
|
return &csi.NodeUnpublishVolumeResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ns *nodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {
|
||||||
|
return &csi.NodeUnstageVolumeResponse{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error) {
|
||||||
|
return &csi.NodeStageVolumeResponse{}, nil
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user