From 753dbc2303da4332231379f744726a3b531e3baf Mon Sep 17 00:00:00 2001 From: Masaki Kimura Date: Tue, 10 Jul 2018 16:48:55 +0000 Subject: [PATCH] Fix Cephfs plugin to return false to ValidateVolumeCapabilities if Block volume is specified Cephfs doesn't have a feature to provide Block Volume, therefore it should return false to ValidateVolumeCapabilities if Block Volume is specified. Fixes #44 --- pkg/cephfs/controllerserver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/cephfs/controllerserver.go b/pkg/cephfs/controllerserver.go index d0e20d9d4..dd1122c22 100644 --- a/pkg/cephfs/controllerserver.go +++ b/pkg/cephfs/controllerserver.go @@ -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 }