From 1f6a9cabfdb74bc96bf1bb066fb2093febf4fe61 Mon Sep 17 00:00:00 2001 From: Yug Date: Thu, 18 Mar 2021 16:58:23 +0530 Subject: [PATCH] rbd: verify if pool name is not empty Validate Snapshot request to check if the passed pool name is not empty. Co-authored-by: Madhu Rajanna Signed-off-by: Yug --- internal/rbd/controllerserver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 503f071be..ab5db3bbc 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -904,7 +904,9 @@ func (cs *ControllerServer) validateSnapshotReq(ctx context.Context, req *csi.Cr if value, ok := options["snapshotNamePrefix"]; ok && value == "" { return status.Error(codes.InvalidArgument, "empty snapshot name prefix to provision snapshot from") } - + if value, ok := options["pool"]; ok && value == "" { + return status.Error(codes.InvalidArgument, "empty pool name in which rbd image will be created") + } return nil }