Skip to content

Commit 50b58c6

Browse files
authored
Merge pull request #17 from davidz627/feature/csiv0.3.0
Bump CSI Spec version to 0.3.0 and make necessary code update
2 parents aa101f7 + ad457d6 commit 50b58c6

33 files changed

+10672
-3976
lines changed

Gopkg.lock

+8-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@
3131

3232
[[constraint]]
3333
name = "github.com/container-storage-interface/spec"
34-
version = "0.2.0"
34+
version = "0.3.0"
35+
36+
# Transitive dependency of CSI Spec
37+
[[override]]
38+
name = "github.com/golang/protobuf"
39+
version = "1.1.0"
3540

3641
[[constraint]]
3742
branch = "master"

pkg/gce-csi-driver/controller.go

+14
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ type GCEControllerServer struct {
3737
CloudProvider gce.GCECompute
3838
}
3939

40+
var _ csi.ControllerServer = &GCEControllerServer{}
41+
4042
const (
4143
// MaxVolumeSizeInBytes is the maximum standard and ssd size of 64TB
4244
MaxVolumeSizeInBytes int64 = 64 * 1024 * 1024 * 1024 * 1024
@@ -425,3 +427,15 @@ func (gceCS *GCEControllerServer) ControllerGetCapabilities(ctx context.Context,
425427
Capabilities: gceCS.Driver.cscap,
426428
}, nil
427429
}
430+
431+
func (gceCS *GCEControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
432+
return nil, status.Error(codes.Unimplemented, "")
433+
}
434+
435+
func (gceCS *GCEControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
436+
return nil, status.Error(codes.Unimplemented, "")
437+
}
438+
439+
func (gceCS *GCEControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
440+
return nil, status.Error(codes.Unimplemented, "")
441+
}

pkg/gce-csi-driver/node.go

+15
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ type GCENodeServer struct {
3535
mux sync.Mutex
3636
}
3737

38+
var _ csi.NodeServer = &GCENodeServer{}
39+
3840
func (ns *GCENodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
3941
ns.mux.Lock()
4042
defer ns.mux.Unlock()
@@ -262,3 +264,16 @@ func (ns *GCENodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeG
262264
Capabilities: ns.Driver.nscap,
263265
}, nil
264266
}
267+
268+
func (ns *GCENodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
269+
glog.Infof("NodeGetInfo called with req: %#v", req)
270+
271+
resp := &csi.NodeGetInfoResponse{
272+
NodeId: ns.Driver.nodeID,
273+
// TODO: Set MaxVolumesPerNode based on Node Type
274+
// Default of 0 means that CO Decides how many nodes can be published
275+
MaxVolumesPerNode: 0,
276+
AccessibleTopology: nil,
277+
}
278+
return resp, nil
279+
}

0 commit comments

Comments
 (0)