diff --git a/internal/controller/vrg_kubeobjects.go b/internal/controller/vrg_kubeobjects.go index 9189dff24..40752f42b 100644 --- a/internal/controller/vrg_kubeobjects.go +++ b/internal/controller/vrg_kubeobjects.go @@ -513,12 +513,12 @@ func (v *VRGInstance) getVRGFromS3Profile(s3ProfileName string) (*ramen.VolumeRe return vrg, nil } -func (v *VRGInstance) kubeObjectsRecover(result *ctrl.Result, s3StoreProfile ramen.S3StoreProfile) error { +func (v *VRGInstance) kubeObjectsRecover(result *ctrl.Result, s3ProfileName string) error { if v.kubeObjectProtectionDisabled("recovery") { return nil } - sourceVrg, err := v.getVRGFromS3Profile(s3StoreProfile.S3ProfileName) + sourceVrg, err := v.getVRGFromS3Profile(s3ProfileName) if err != nil { return fmt.Errorf("kube objects source VRG get error: %v", err) } @@ -529,9 +529,9 @@ func (v *VRGInstance) kubeObjectsRecover(result *ctrl.Result, s3StoreProfile ram } v.instance.Status.KubeObjectProtection.CaptureToRecoverFrom = captureToRecoverFromIdentifier - log := v.log.WithValues("number", captureToRecoverFromIdentifier.Number, "profile", s3StoreProfile.S3ProfileName) + log := v.log.WithValues("number", captureToRecoverFromIdentifier.Number, "profile", s3ProfileName) - return v.kubeObjectsRecoveryStartOrResume(result, s3StoreProfile.S3ProfileName, captureToRecoverFromIdentifier, log) + return v.kubeObjectsRecoveryStartOrResume(result, s3ProfileName, captureToRecoverFromIdentifier, log) } func (v *VRGInstance) findS3StoreAccessor(s3StoreProfile ramen.S3StoreProfile) (s3StoreAccessor, error) { diff --git a/internal/controller/vrg_volrep.go b/internal/controller/vrg_volrep.go index a96be43df..1bdbdf236 100644 --- a/internal/controller/vrg_volrep.go +++ b/internal/controller/vrg_volrep.go @@ -2010,9 +2010,7 @@ func (v *VRGInstance) restorePVsAndPVCsFromS3(result *ctrl.Result) (int, error) var objectStore ObjectStorer - var s3StoreProfile ramendrv1alpha1.S3StoreProfile - - objectStore, s3StoreProfile, err = v.reconciler.ObjStoreGetter.ObjectStore( + objectStore, _, err = v.reconciler.ObjStoreGetter.ObjectStore( v.ctx, v.reconciler.APIReader, s3ProfileName, v.namespacedName, v.log) if err != nil { v.log.Error(err, "Kube objects recovery object store inaccessible", "profile", s3ProfileName) @@ -2046,7 +2044,7 @@ func (v *VRGInstance) restorePVsAndPVCsFromS3(result *ctrl.Result) (int, error) v.log.Info(fmt.Sprintf("Restored %d PVs and %d PVCs using profile %s", pvCount, pvcCount, s3ProfileName)) - return pvCount + pvcCount, v.kubeObjectsRecover(result, s3StoreProfile) + return pvCount + pvcCount, v.kubeObjectsRecover(result, s3ProfileName) } if NoS3 {