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
@ -752,14 +752,8 @@ func genVolFromVolID(ctx context.Context, volumeID string, cr *util.Credentials,
|
||||
}
|
||||
|
||||
if rbdVol.ImageID == "" {
|
||||
err = rbdVol.getImageID()
|
||||
err = rbdVol.storeImageID(ctx, j)
|
||||
if err != nil {
|
||||
util.ErrorLog(ctx, "failed to get image id %s: %v", rbdVol, err)
|
||||
return rbdVol, err
|
||||
}
|
||||
err = j.StoreImageID(ctx, rbdVol.JournalPool, rbdVol.ReservedID, rbdVol.ImageID)
|
||||
if err != nil {
|
||||
util.ErrorLog(ctx, "failed to store volume id %s: %v", rbdVol, err)
|
||||
return rbdVol, err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user