mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cleanup: add a helper function storeImageID
added a helper function storeImageID to reduce code duplication. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
b2fb43b335
commit
43fde0a30a
@ -494,15 +494,8 @@ func (cs *ControllerServer) createBackingImage(ctx context.Context, cr *util.Cre
|
||||
}
|
||||
}
|
||||
}()
|
||||
err = rbdVol.getImageID()
|
||||
err = rbdVol.storeImageID(ctx, j)
|
||||
if err != nil {
|
||||
util.ErrorLog(ctx, "failed to get volume id %s: %v", rbdVol, err)
|
||||
return status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
err = j.StoreImageID(ctx, rbdVol.JournalPool, rbdVol.ReservedID, rbdVol.ImageID)
|
||||
if err != nil {
|
||||
util.ErrorLog(ctx, "failed to reserve volume %s: %v", rbdVol, err)
|
||||
return status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user