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 <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-03-15 08:02:54 +01:00 committed by mergify[bot]
parent 92b2e08adf
commit b6aa19eea5

View File

@ -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) {