csi: Add csi.NodeStageVolume to the NodeClient

Implements a fake version of NodeStageVolume as a dependency of
implementing the client.NodeStageVolume request
This commit is contained in:
Danielle Lancashire
2020-01-23 12:20:36 +01:00
committed by Tim Gross
parent ba1c77a998
commit 3086c72650
2 changed files with 7 additions and 0 deletions

View File

@@ -67,6 +67,8 @@ type CSIControllerClient interface {
type CSINodeClient interface {
NodeGetCapabilities(ctx context.Context, in *csipbv1.NodeGetCapabilitiesRequest, opts ...grpc.CallOption) (*csipbv1.NodeGetCapabilitiesResponse, error)
NodeGetInfo(ctx context.Context, in *csipbv1.NodeGetInfoRequest, opts ...grpc.CallOption) (*csipbv1.NodeGetInfoResponse, error)
NodeStageVolume(ctx context.Context, in *csipbv1.NodeStageVolumeRequest, opts ...grpc.CallOption) (*csipbv1.NodeStageVolumeResponse, error)
// NodeUnstageVolume(ctx context.Context, in *NodeUnstageVolumeRequest, opts ...grpc.CallOption) (*NodeUnstageVolumeResponse, error)
}
type client struct {

View File

@@ -83,6 +83,7 @@ type NodeClient struct {
NextErr error
NextCapabilitiesResponse *csipbv1.NodeGetCapabilitiesResponse
NextGetInfoResponse *csipbv1.NodeGetInfoResponse
NextStageVolumeResponse *csipbv1.NodeStageVolumeResponse
}
// NewNodeClient returns a new ControllerClient
@@ -103,3 +104,7 @@ func (c *NodeClient) NodeGetCapabilities(ctx context.Context, in *csipbv1.NodeGe
func (c *NodeClient) NodeGetInfo(ctx context.Context, in *csipbv1.NodeGetInfoRequest, opts ...grpc.CallOption) (*csipbv1.NodeGetInfoResponse, error) {
return c.NextGetInfoResponse, c.NextErr
}
func (c *NodeClient) NodeStageVolume(ctx context.Context, in *csipbv1.NodeStageVolumeRequest, opts ...grpc.CallOption) (*csipbv1.NodeStageVolumeResponse, error) {
return c.NextStageVolumeResponse, c.NextErr
}