@@ -410,7 +410,7 @@ func (r *MantleBackupReconciler) reconcilePre(ctx context.Context, backup *mantl
410410 return ctrl.Result {}, err
411411 }
412412
413- if ! backup .IsReady () {
413+ if ! backup .IsSnapshotCaptured () {
414414 if err := r .provisionRBDSnapshot (ctx , backup , target ); err != nil {
415415 return ctrl.Result {}, err
416416 }
@@ -498,14 +498,14 @@ func (r *MantleBackupReconciler) reconcileAsSecondary(ctx context.Context, backu
498498 return ctrl.Result {}, err
499499 }
500500
501- if ! backup .IsReady () {
501+ if ! backup .IsSnapshotCaptured () {
502502 result , err := r .startImport (ctx , backup , target )
503503 if err != nil || ! result .IsZero () {
504504 return result , err
505505 }
506506 }
507507
508- if backup .IsReady () && ! backup .IsVerified () {
508+ if backup .IsSnapshotCaptured () && ! backup .IsVerified () {
509509 if err := r .verify (ctx , backup ); err != nil {
510510 return ctrl.Result {}, err
511511 }
@@ -568,7 +568,7 @@ func (r *MantleBackupReconciler) replicate(
568568 return ctrl.Result {}, err
569569 }
570570
571- if prepareResult .isSecondaryMantleBackupReadyToUse {
571+ if prepareResult .isSecondaryMantleBackupSnapshotCaptured {
572572 if err := r .updateMantleBackupCondition (
573573 ctx , backup ,
574574 mantlev1 .BackupConditionSyncedToRemote ,
@@ -860,7 +860,7 @@ func (r *MantleBackupReconciler) provisionRBDSnapshot(
860860 }
861861
862862 meta .SetStatusCondition (& backup .Status .Conditions , metav1.Condition {
863- Type : mantlev1 .BackupConditionReadyToUse , Status : metav1 .ConditionTrue , Reason : mantlev1 .ConditionReasonReadyToUseNoProblem })
863+ Type : mantlev1 .BackupConditionSnapshotCaptured , Status : metav1 .ConditionTrue , Reason : mantlev1 .ConditionReasonSnapshotCapturedNoProblem })
864864 return nil
865865 }); err != nil {
866866 logger .Error (err , "failed to update MantleBackup status" , "status" , backup .Status )
@@ -954,9 +954,9 @@ func (r *MantleBackupReconciler) finalizeSecondary(
954954}
955955
956956type dataSyncPrepareResult struct {
957- isIncremental bool // NOTE: The value is forcibly set to false if isSecondaryMantleBackupReadyToUse is true.
958- isSecondaryMantleBackupReadyToUse bool
959- diffFrom * mantlev1.MantleBackup // non-nil value iff isIncremental is true.
957+ isIncremental bool // NOTE: The value is forcibly set to false if isSecondaryMantleBackupSnapshotCaptured is true.
958+ isSecondaryMantleBackupSnapshotCaptured bool
959+ diffFrom * mantlev1.MantleBackup // non-nil value iff isIncremental is true.
960960}
961961
962962func (r * MantleBackupReconciler ) prepareForDataSynchronization (
@@ -990,23 +990,23 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
990990 return nil , fmt .Errorf ("secondary MantleBackup not found: %s, %s" ,
991991 backup .GetName (), backup .GetNamespace ())
992992 }
993- isSecondaryMantleBackupReadyToUse := secondaryBackup .IsReady ()
993+ isSecondaryMantleBackupSnapshotCaptured := secondaryBackup .IsSnapshotCaptured ()
994994
995- if isSecondaryMantleBackupReadyToUse {
995+ if isSecondaryMantleBackupSnapshotCaptured {
996996 return & dataSyncPrepareResult {
997- isIncremental : false ,
998- isSecondaryMantleBackupReadyToUse : true ,
999- diffFrom : nil ,
997+ isIncremental : false ,
998+ isSecondaryMantleBackupSnapshotCaptured : true ,
999+ diffFrom : nil ,
10001000 }, nil
10011001 }
10021002
10031003 if syncMode , ok := backup .GetAnnotations ()[annotSyncMode ]; ok {
10041004 switch syncMode {
10051005 case syncModeFull :
10061006 return & dataSyncPrepareResult {
1007- isIncremental : false ,
1008- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
1009- diffFrom : nil ,
1007+ isIncremental : false ,
1008+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
1009+ diffFrom : nil ,
10101010 }, nil
10111011 case syncModeIncremental :
10121012 diffFromName , ok := backup .GetAnnotations ()[annotDiffFrom ]
@@ -1024,9 +1024,9 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
10241024 }
10251025
10261026 return & dataSyncPrepareResult {
1027- isIncremental : true ,
1028- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
1029- diffFrom : & diffFrom ,
1027+ isIncremental : true ,
1028+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
1029+ diffFrom : & diffFrom ,
10301030 }, nil
10311031 default :
10321032 return nil , fmt .Errorf ("unknown sync mode: %s" , syncMode )
@@ -1047,9 +1047,9 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
10471047 isIncremental := (diffFrom != nil )
10481048
10491049 return & dataSyncPrepareResult {
1050- isIncremental : isIncremental ,
1051- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
1052- diffFrom : diffFrom ,
1050+ isIncremental : isIncremental ,
1051+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
1052+ diffFrom : diffFrom ,
10531053 }, nil
10541054}
10551055
@@ -1072,7 +1072,7 @@ func searchForDiffOriginMantleBackup(
10721072 if ! ok {
10731073 continue
10741074 }
1075- if ! primaryBackup .IsReady () || ! secondaryBackup .IsReady () {
1075+ if ! primaryBackup .IsSnapshotCaptured () || ! secondaryBackup .IsSnapshotCaptured () {
10761076 continue
10771077 }
10781078 if ! primaryBackup .DeletionTimestamp .IsZero () || ! secondaryBackup .DeletionTimestamp .IsZero () {
@@ -1979,8 +1979,8 @@ func (r *MantleBackupReconciler) startImport(
19791979 return ctrl.Result {}, fmt .Errorf ("failed to unlock the volume: %w" , err )
19801980 }
19811981
1982- if err := r .markSecondaryReadyToUse (ctx , backup , target ); err != nil {
1983- return ctrl.Result {}, fmt .Errorf ("failed to mark the secondary as ready to use : %w" , err )
1982+ if err := r .markSecondarySnapshotCaptured (ctx , backup , target ); err != nil {
1983+ return ctrl.Result {}, fmt .Errorf ("failed to mark the secondary as snapshot captured : %w" , err )
19841984 }
19851985
19861986 return ctrl.Result {}, nil
@@ -2721,8 +2721,8 @@ func (r *MantleBackupReconciler) createOrUpdateImportJob(
27212721 return err
27222722}
27232723
2724- // markSecondaryReadyToUse marks the MantleBackup ReadyToUse as True.
2725- func (r * MantleBackupReconciler ) markSecondaryReadyToUse (
2724+ // markSecondarySnapshotCaptured marks the MantleBackup SnapshotCaptured as True.
2725+ func (r * MantleBackupReconciler ) markSecondarySnapshotCaptured (
27262726 ctx context.Context ,
27272727 backup * mantlev1.MantleBackup ,
27282728 snapshotTarget * snapshotTarget ,
@@ -2738,13 +2738,13 @@ func (r *MantleBackupReconciler) markSecondaryReadyToUse(
27382738 return fmt .Errorf ("failed to find imported RBD snapshot: %w" , err )
27392739 }
27402740
2741- // Update the status of the MantleBackup to set True to the ReadyToUse condition.
2741+ // Update the status of the MantleBackup to set True to the SnapshotCaptured condition.
27422742 if err := updateStatus (ctx , r .Client , backup , func () error {
27432743 backup .Status .SnapID = & snapshot .Id
27442744 meta .SetStatusCondition (& backup .Status .Conditions , metav1.Condition {
2745- Type : mantlev1 .BackupConditionReadyToUse ,
2745+ Type : mantlev1 .BackupConditionSnapshotCaptured ,
27462746 Status : metav1 .ConditionTrue ,
2747- Reason : mantlev1 .ConditionReasonReadyToUseNoProblem ,
2747+ Reason : mantlev1 .ConditionReasonSnapshotCapturedNoProblem ,
27482748 })
27492749 return nil
27502750 }); err != nil {
0 commit comments