mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
add controllerModifyVolume test function
Signed-off-by: Humble Chirammal <humble.devassy@gmail.com>
This commit is contained in:
parent
e0a4cb0962
commit
d8458293d2
@ -319,6 +319,14 @@ func (mr *MockControllerServerMockRecorder) ValidateVolumeCapabilities(arg0, arg
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateVolumeCapabilities", reflect.TypeOf((*MockControllerServer)(nil).ValidateVolumeCapabilities), arg0, arg1)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateVolumeCapabilities", reflect.TypeOf((*MockControllerServer)(nil).ValidateVolumeCapabilities), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MockControllerServer) ControllerModifyVolume(arg0 context.Context, arg1 *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ModifyVolume", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(*csi.ControllerModifyVolumeResponse)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
// MockNodeServer is a mock of NodeServer interface.
|
// MockNodeServer is a mock of NodeServer interface.
|
||||||
type MockNodeServer struct {
|
type MockNodeServer struct {
|
||||||
ctrl *gomock.Controller
|
ctrl *gomock.Controller
|
||||||
|
@ -567,6 +567,13 @@ func (s *service) ControllerGetCapabilities(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Type: &csi.ControllerServiceCapability_Rpc{
|
||||||
|
Rpc: &csi.ControllerServiceCapability_RPC{
|
||||||
|
Type: csi.ControllerServiceCapability_RPC_MODIFY_VOLUME,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if !s.config.DisableAttach {
|
if !s.config.DisableAttach {
|
||||||
@ -736,6 +743,14 @@ func (s *service) ControllerExpandVolume(
|
|||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *service) ControllerModifyVolume(
|
||||||
|
ctx context.Context,
|
||||||
|
req *csi.ControllerModifyVolumeRequest) (*csi.ControllerModifyVolumeResponse, error) {
|
||||||
|
// todo: implement the functionality while we add the modifyVolume test
|
||||||
|
resp := &csi.ControllerModifyVolumeResponse{}
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
func getSnapshotById(s *service, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
|
func getSnapshotById(s *service, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error) {
|
||||||
if len(req.GetSnapshotId()) != 0 {
|
if len(req.GetSnapshotId()) != 0 {
|
||||||
i, snapshot := s.snapshots.FindSnapshot("id", req.GetSnapshotId())
|
i, snapshot := s.snapshots.FindSnapshot("id", req.GetSnapshotId())
|
||||||
|
Loading…
Reference in New Issue
Block a user