Merge pull request #45 from mkimuram/issue/44

Fix Cephfs plugin to return false to ValidateVolumeCapabilities if Block volume is specified
This commit is contained in:
Huamin Chen 2018-07-10 12:57:30 -04:00 committed by GitHub
commit 5ad8b16e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,5 +185,11 @@ func (cs *controllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
func (cs *controllerServer) ValidateVolumeCapabilities(
ctx context.Context,
req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error) {
// Cephfs doesn't support Block volume
for _, cap := range req.VolumeCapabilities {
if cap.GetBlock() != nil {
return &csi.ValidateVolumeCapabilitiesResponse{Supported: false, Message: ""}, nil
}
}
return &csi.ValidateVolumeCapabilitiesResponse{Supported: true}, nil
}