@@ -429,7 +429,7 @@ func (r *MantleBackupReconciler) reconcileLocalBackup(ctx context.Context, backu
429429 return ctrl.Result {}, err
430430 }
431431
432- if ! backup .IsReady () {
432+ if ! backup .IsSnapshotCaptured () {
433433 if err := r .provisionRBDSnapshot (ctx , backup , target ); err != nil {
434434 return ctrl.Result {}, err
435435 }
@@ -519,14 +519,14 @@ func (r *MantleBackupReconciler) reconcileAsSecondary(ctx context.Context, backu
519519 return ctrl.Result {}, err
520520 }
521521
522- if ! backup .IsReady () {
522+ if ! backup .IsSnapshotCaptured () {
523523 result , err := r .startImport (ctx , backup , target )
524524 if err != nil || ! result .IsZero () {
525525 return result , err
526526 }
527527 }
528528
529- if backup .IsReady () && ! backup .IsVerifiedTrue () && ! backup .IsVerifiedFalse () {
529+ if backup .IsSnapshotCaptured () && ! backup .IsVerifiedTrue () && ! backup .IsVerifiedFalse () {
530530 if err := r .verify (ctx , backup ); err != nil {
531531 return ctrl.Result {}, err
532532 }
@@ -590,7 +590,7 @@ func (r *MantleBackupReconciler) replicate(
590590 return ctrl.Result {}, err
591591 }
592592
593- if prepareResult .isSecondaryMantleBackupReadyToUse {
593+ if prepareResult .isSecondaryMantleBackupSnapshotCaptured {
594594 if err := r .updateMantleBackupCondition (
595595 ctx , backup ,
596596 mantlev1 .BackupConditionSyncedToRemote ,
@@ -888,7 +888,7 @@ func (r *MantleBackupReconciler) provisionRBDSnapshot(
888888 }
889889
890890 meta .SetStatusCondition (& backup .Status .Conditions , metav1.Condition {
891- Type : mantlev1 .BackupConditionReadyToUse , Status : metav1 .ConditionTrue , Reason : mantlev1 .ConditionReasonReadyToUseNoProblem })
891+ Type : mantlev1 .BackupConditionSnapshotCaptured , Status : metav1 .ConditionTrue , Reason : mantlev1 .ConditionReasonSnapshotCapturedNoProblem })
892892
893893 return nil
894894 }); err != nil {
@@ -987,9 +987,9 @@ func (r *MantleBackupReconciler) finalizeSecondary(
987987}
988988
989989type dataSyncPrepareResult struct {
990- isIncremental bool // NOTE: The value is forcibly set to false if isSecondaryMantleBackupReadyToUse is true.
991- isSecondaryMantleBackupReadyToUse bool
992- diffFrom * mantlev1.MantleBackup // non-nil value iff isIncremental is true.
990+ isIncremental bool // NOTE: The value is forcibly set to false if isSecondaryMantleBackupSnapshotCaptured is true.
991+ isSecondaryMantleBackupSnapshotCaptured bool
992+ diffFrom * mantlev1.MantleBackup // non-nil value iff isIncremental is true.
993993}
994994
995995func (r * MantleBackupReconciler ) prepareForDataSynchronization (
@@ -1023,23 +1023,23 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
10231023 return nil , fmt .Errorf ("secondary MantleBackup not found: %s, %s" ,
10241024 backup .GetName (), backup .GetNamespace ())
10251025 }
1026- isSecondaryMantleBackupReadyToUse := secondaryBackup .IsReady ()
1026+ isSecondaryMantleBackupSnapshotCaptured := secondaryBackup .IsSnapshotCaptured ()
10271027
1028- if isSecondaryMantleBackupReadyToUse {
1028+ if isSecondaryMantleBackupSnapshotCaptured {
10291029 return & dataSyncPrepareResult {
1030- isIncremental : false ,
1031- isSecondaryMantleBackupReadyToUse : true ,
1032- diffFrom : nil ,
1030+ isIncremental : false ,
1031+ isSecondaryMantleBackupSnapshotCaptured : true ,
1032+ diffFrom : nil ,
10331033 }, nil
10341034 }
10351035
10361036 if syncMode , ok := backup .GetAnnotations ()[annotSyncMode ]; ok {
10371037 switch syncMode {
10381038 case syncModeFull :
10391039 return & dataSyncPrepareResult {
1040- isIncremental : false ,
1041- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
1042- diffFrom : nil ,
1040+ isIncremental : false ,
1041+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
1042+ diffFrom : nil ,
10431043 }, nil
10441044 case syncModeIncremental :
10451045 diffFromName , ok := backup .GetAnnotations ()[annotDiffFrom ]
@@ -1057,9 +1057,9 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
10571057 }
10581058
10591059 return & dataSyncPrepareResult {
1060- isIncremental : true ,
1061- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
1062- diffFrom : & diffFrom ,
1060+ isIncremental : true ,
1061+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
1062+ diffFrom : & diffFrom ,
10631063 }, nil
10641064 default :
10651065 return nil , fmt .Errorf ("unknown sync mode: %s" , syncMode )
@@ -1080,9 +1080,9 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
10801080 isIncremental := (diffFrom != nil )
10811081
10821082 return & dataSyncPrepareResult {
1083- isIncremental : isIncremental ,
1084- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
1085- diffFrom : diffFrom ,
1083+ isIncremental : isIncremental ,
1084+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
1085+ diffFrom : diffFrom ,
10861086 }, nil
10871087}
10881088
@@ -1106,7 +1106,7 @@ func searchForDiffOriginMantleBackup(
11061106 if ! ok {
11071107 continue
11081108 }
1109- if ! primaryBackup .IsReady () || ! secondaryBackup .IsReady () {
1109+ if ! primaryBackup .IsSnapshotCaptured () || ! secondaryBackup .IsSnapshotCaptured () {
11101110 continue
11111111 }
11121112 if ! primaryBackup .DeletionTimestamp .IsZero () || ! secondaryBackup .DeletionTimestamp .IsZero () {
@@ -2030,8 +2030,8 @@ func (r *MantleBackupReconciler) startImport(
20302030 return ctrl.Result {}, fmt .Errorf ("failed to unlock the volume: %w" , err )
20312031 }
20322032
2033- if err := r .markSecondaryReadyToUse (ctx , backup , target ); err != nil {
2034- return ctrl.Result {}, fmt .Errorf ("failed to mark the secondary as ready to use : %w" , err )
2033+ if err := r .markSecondarySnapshotCaptured (ctx , backup , target ); err != nil {
2034+ return ctrl.Result {}, fmt .Errorf ("failed to mark the secondary as snapshot captured : %w" , err )
20352035 }
20362036
20372037 return ctrl.Result {}, nil
@@ -2821,8 +2821,8 @@ func (r *MantleBackupReconciler) createOrUpdateImportJob(
28212821 return err
28222822}
28232823
2824- // markSecondaryReadyToUse marks the MantleBackup ReadyToUse as True.
2825- func (r * MantleBackupReconciler ) markSecondaryReadyToUse (
2824+ // markSecondarySnapshotCaptured marks the MantleBackup SnapshotCaptured as True.
2825+ func (r * MantleBackupReconciler ) markSecondarySnapshotCaptured (
28262826 ctx context.Context ,
28272827 backup * mantlev1.MantleBackup ,
28282828 snapshotTarget * snapshotTarget ,
@@ -2838,13 +2838,13 @@ func (r *MantleBackupReconciler) markSecondaryReadyToUse(
28382838 return fmt .Errorf ("failed to find imported RBD snapshot: %w" , err )
28392839 }
28402840
2841- // Update the status of the MantleBackup to set True to the ReadyToUse condition.
2841+ // Update the status of the MantleBackup to set True to the SnapshotCaptured condition.
28422842 if err := updateStatus (ctx , r .Client , backup , func () error {
28432843 backup .Status .SnapID = & snapshot .Id
28442844 meta .SetStatusCondition (& backup .Status .Conditions , metav1.Condition {
2845- Type : mantlev1 .BackupConditionReadyToUse ,
2845+ Type : mantlev1 .BackupConditionSnapshotCaptured ,
28462846 Status : metav1 .ConditionTrue ,
2847- Reason : mantlev1 .ConditionReasonReadyToUseNoProblem ,
2847+ Reason : mantlev1 .ConditionReasonSnapshotCapturedNoProblem ,
28482848 })
28492849
28502850 return nil
0 commit comments