Skip to content

Bump CSI Spec version to 0.3.0 and make necessary code update #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@

[[constraint]]
name = "github.com/container-storage-interface/spec"
version = "0.2.0"
version = "0.3.0"

# Transitive dependency of CSI Spec
[[override]]
name = "github.com/golang/protobuf"
version = "1.1.0"

[[constraint]]
branch = "master"
Expand Down
14 changes: 14 additions & 0 deletions pkg/gce-csi-driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ type GCEControllerServer struct {
CloudProvider gce.GCECompute
}

var _ csi.ControllerServer = &GCEControllerServer{}

const (
// MaxVolumeSizeInBytes is the maximum standard and ssd size of 64TB
MaxVolumeSizeInBytes int64 = 64 * 1024 * 1024 * 1024 * 1024
Expand Down Expand Up @@ -425,3 +427,15 @@ func (gceCS *GCEControllerServer) ControllerGetCapabilities(ctx context.Context,
Capabilities: gceCS.Driver.cscap,
}, nil
}

func (gceCS *GCEControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

func (gceCS *GCEControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}

func (gceCS *GCEControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
return nil, status.Error(codes.Unimplemented, "")
}
15 changes: 15 additions & 0 deletions pkg/gce-csi-driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ type GCENodeServer struct {
mux sync.Mutex
}

var _ csi.NodeServer = &GCENodeServer{}

func (ns *GCENodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
ns.mux.Lock()
defer ns.mux.Unlock()
Expand Down Expand Up @@ -262,3 +264,16 @@ func (ns *GCENodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeG
Capabilities: ns.Driver.nscap,
}, nil
}

func (ns *GCENodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
glog.Infof("NodeGetInfo called with req: %#v", req)

resp := &csi.NodeGetInfoResponse{
NodeId: ns.Driver.nodeID,
// TODO: Set MaxVolumesPerNode based on Node Type
// Default of 0 means that CO Decides how many nodes can be published
MaxVolumesPerNode: 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open a tracking issue for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#19

AccessibleTopology: nil,
}
return resp, nil
}
Loading