From b6aa19eea5d7e45ebde65ac68a58283d922a6c9f Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 15 Mar 2021 08:02:54 +0100 Subject: [PATCH] rbd: pass secrets when creating an source rbdVolume for cloning Without this, the rbdVolume can not connect to the Ceph cluster and configure the (optional) encryption. Signed-off-by: Niels de Vos --- internal/rbd/controllerserver.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index e8d7460aa..29563d6d8 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -559,8 +559,7 @@ func checkContentSource(ctx context.Context, req *csi.CreateVolumeRequest, cr *u if volID == "" { return nil, nil, status.Errorf(codes.NotFound, "volume ID cannot be empty") } - // TODO need to support cloning for encrypted volume - rbdvol, err := genVolFromVolID(ctx, volID, cr, nil) + rbdvol, err := genVolFromVolID(ctx, volID, cr, req.GetSecrets()) if err != nil { util.ErrorLog(ctx, "failed to get backend image for %s: %v", volID, err) if !errors.Is(err, ErrImageNotFound) {