mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-01-30 16:49:29 +00:00
rbd: remove unused ControllerPublishVolume and ControllerUnpublishVolume
The RBD ControllerService does not expose the `PUBLISH_UNPUBLISH_VOLUME` capability, so ControllerPublishVolume and ControllerUnpublishVolume will never get called. In case a broken Container Orchestrator does call these operations, a default Unimplemented error will be returned anyway. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
27624a71ee
commit
24a66af3af
@ -1600,36 +1600,3 @@ func (cs *ControllerServer) ControllerExpandVolume(
|
|||||||
NodeExpansionRequired: nodeExpansion,
|
NodeExpansionRequired: nodeExpansion,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ControllerPublishVolume is a dummy publish implementation to mimic a successful attach operation being a NOOP.
|
|
||||||
func (cs *ControllerServer) ControllerPublishVolume(
|
|
||||||
ctx context.Context,
|
|
||||||
req *csi.ControllerPublishVolumeRequest,
|
|
||||||
) (*csi.ControllerPublishVolumeResponse, error) {
|
|
||||||
if req.GetVolumeId() == "" {
|
|
||||||
return nil, status.Error(codes.InvalidArgument, "Volume ID cannot be empty")
|
|
||||||
}
|
|
||||||
if req.GetNodeId() == "" {
|
|
||||||
return nil, status.Error(codes.InvalidArgument, "Node ID cannot be empty")
|
|
||||||
}
|
|
||||||
if req.GetVolumeCapability() == nil {
|
|
||||||
return nil, status.Error(codes.InvalidArgument, "Volume Capabilities cannot be empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
return &csi.ControllerPublishVolumeResponse{
|
|
||||||
// the dummy response carry an empty map in its response.
|
|
||||||
PublishContext: map[string]string{},
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ControllerUnPublishVolume is a dummy unpublish implementation to mimic a successful attach operation being a NOOP.
|
|
||||||
func (cs *ControllerServer) ControllerUnpublishVolume(
|
|
||||||
ctx context.Context,
|
|
||||||
req *csi.ControllerUnpublishVolumeRequest,
|
|
||||||
) (*csi.ControllerUnpublishVolumeResponse, error) {
|
|
||||||
if req.GetVolumeId() == "" {
|
|
||||||
return nil, status.Error(codes.InvalidArgument, "Volume ID cannot be empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
return &csi.ControllerUnpublishVolumeResponse{}, nil
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user