mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: refractor RegenerateJournal() to take in volumeAttributes
This commit refractors RegenerateJournal() to take in volumeAttributes map[string]string as argument so it can extract required attributes internally. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
@ -172,10 +172,7 @@ func (r ReconcilePersistentVolume) reconcilePV(ctx context.Context, obj runtime.
|
||||
if pv.Spec.CSI == nil || pv.Spec.CSI.Driver != r.config.DriverName {
|
||||
return nil
|
||||
}
|
||||
pool := pv.Spec.CSI.VolumeAttributes["pool"]
|
||||
journalPool := pv.Spec.CSI.VolumeAttributes["journalPool"]
|
||||
requestName := pv.Name
|
||||
imageName := pv.Spec.CSI.VolumeAttributes["imageName"]
|
||||
volumeHandler := pv.Spec.CSI.VolumeHandle
|
||||
secretName := ""
|
||||
secretNamespace := ""
|
||||
@ -210,7 +207,7 @@ func (r ReconcilePersistentVolume) reconcilePV(ctx context.Context, obj runtime.
|
||||
}
|
||||
defer cr.DeleteCredentials()
|
||||
|
||||
rbdVolID, err := rbd.RegenerateJournal(imageName, volumeHandler, pool, journalPool, requestName, cr)
|
||||
rbdVolID, err := rbd.RegenerateJournal(pv.Spec.CSI.VolumeAttributes, volumeHandler, requestName, cr)
|
||||
if err != nil {
|
||||
util.ErrorLogMsg("failed to regenerate journal %s", err)
|
||||
|
||||
|
Reference in New Issue
Block a user