@@ -462,7 +462,7 @@ func (r *MantleBackupReconciler) reconcileAsSecondary(ctx context.Context, backu
462462 return ctrl.Result {}, err
463463 }
464464
465- if backup .IsReady () {
465+ if backup .IsSnapshotCaptured () {
466466 return r .secondaryCleanup (ctx , backup , true )
467467 }
468468
@@ -525,7 +525,7 @@ func (r *MantleBackupReconciler) replicate(
525525 return ctrl.Result {}, err
526526 }
527527
528- if prepareResult .isSecondaryMantleBackupReadyToUse {
528+ if prepareResult .isSecondaryMantleBackupSnapshotCaptured {
529529 return r .primaryCleanup (ctx , backup )
530530 }
531531 return r .startExportAndUpload (ctx , backup , prepareResult )
@@ -772,7 +772,7 @@ func (r *MantleBackupReconciler) provisionRBDSnapshot(
772772 }
773773
774774 // If the given MantleBackup is not ready to use, create a new RBD snapshot and update its status.
775- if backup .IsReady () {
775+ if backup .IsSnapshotCaptured () {
776776 return nil
777777 }
778778
@@ -801,7 +801,7 @@ func (r *MantleBackupReconciler) provisionRBDSnapshot(
801801 backup .Status .SnapSize = & snapshot .Size
802802
803803 meta .SetStatusCondition (& backup .Status .Conditions , metav1.Condition {
804- Type : mantlev1 .BackupConditionReadyToUse , Status : metav1 .ConditionTrue , Reason : mantlev1 .ConditionReasonReadyToUseNoProblem })
804+ Type : mantlev1 .BackupConditionSnapshotCaptured , Status : metav1 .ConditionTrue , Reason : mantlev1 .ConditionReasonSnapshotCapturedNoProblem })
805805 return nil
806806 }); err != nil {
807807 logger .Error (err , "failed to update MantleBackup status" , "status" , backup .Status )
@@ -895,9 +895,9 @@ func (r *MantleBackupReconciler) finalizeSecondary(
895895}
896896
897897type dataSyncPrepareResult struct {
898- isIncremental bool // NOTE: The value is forcibly set to false if isSecondaryMantleBackupReadyToUse is true.
899- isSecondaryMantleBackupReadyToUse bool
900- diffFrom * mantlev1.MantleBackup // non-nil value iff isIncremental is true.
898+ isIncremental bool // NOTE: The value is forcibly set to false if isSecondaryMantleBackupSnapshotCaptured is true.
899+ isSecondaryMantleBackupSnapshotCaptured bool
900+ diffFrom * mantlev1.MantleBackup // non-nil value iff isIncremental is true.
901901}
902902
903903func (r * MantleBackupReconciler ) prepareForDataSynchronization (
@@ -931,23 +931,23 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
931931 return nil , fmt .Errorf ("secondary MantleBackup not found: %s, %s" ,
932932 backup .GetName (), backup .GetNamespace ())
933933 }
934- isSecondaryMantleBackupReadyToUse := secondaryBackup .IsReady ()
934+ isSecondaryMantleBackupSnapshotCaptured := secondaryBackup .IsSnapshotCaptured ()
935935
936- if isSecondaryMantleBackupReadyToUse {
936+ if isSecondaryMantleBackupSnapshotCaptured {
937937 return & dataSyncPrepareResult {
938- isIncremental : false ,
939- isSecondaryMantleBackupReadyToUse : true ,
940- diffFrom : nil ,
938+ isIncremental : false ,
939+ isSecondaryMantleBackupSnapshotCaptured : true ,
940+ diffFrom : nil ,
941941 }, nil
942942 }
943943
944944 if syncMode , ok := backup .GetAnnotations ()[annotSyncMode ]; ok {
945945 switch syncMode {
946946 case syncModeFull :
947947 return & dataSyncPrepareResult {
948- isIncremental : false ,
949- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
950- diffFrom : nil ,
948+ isIncremental : false ,
949+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
950+ diffFrom : nil ,
951951 }, nil
952952 case syncModeIncremental :
953953 diffFromName , ok := backup .GetAnnotations ()[annotDiffFrom ]
@@ -965,9 +965,9 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
965965 }
966966
967967 return & dataSyncPrepareResult {
968- isIncremental : true ,
969- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
970- diffFrom : & diffFrom ,
968+ isIncremental : true ,
969+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
970+ diffFrom : & diffFrom ,
971971 }, nil
972972 default :
973973 return nil , fmt .Errorf ("unknown sync mode: %s" , syncMode )
@@ -988,9 +988,9 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization(
988988 isIncremental := (diffFrom != nil )
989989
990990 return & dataSyncPrepareResult {
991- isIncremental : isIncremental ,
992- isSecondaryMantleBackupReadyToUse : isSecondaryMantleBackupReadyToUse ,
993- diffFrom : diffFrom ,
991+ isIncremental : isIncremental ,
992+ isSecondaryMantleBackupSnapshotCaptured : isSecondaryMantleBackupSnapshotCaptured ,
993+ diffFrom : diffFrom ,
994994 }, nil
995995}
996996
@@ -1013,7 +1013,7 @@ func searchForDiffOriginMantleBackup(
10131013 if ! ok {
10141014 continue
10151015 }
1016- if ! primaryBackup .IsReady () || ! secondaryBackup .IsReady () {
1016+ if ! primaryBackup .IsSnapshotCaptured () || ! secondaryBackup .IsSnapshotCaptured () {
10171017 continue
10181018 }
10191019 if ! primaryBackup .DeletionTimestamp .IsZero () || ! secondaryBackup .DeletionTimestamp .IsZero () {
@@ -2382,13 +2382,13 @@ func (r *MantleBackupReconciler) reconcileImportJob(
23822382 return ctrl.Result {}, fmt .Errorf ("failed to find imported RBD snapshot: %w" , err )
23832383 }
23842384
2385- // Update the status of the MantleBackup to set True to the ReadyToUse condition.
2385+ // Update the status of the MantleBackup to set True to the SnapshotCaptured condition.
23862386 if err := updateStatus (ctx , r .Client , backup , func () error {
23872387 backup .Status .SnapID = & snapshot .Id
23882388 meta .SetStatusCondition (& backup .Status .Conditions , metav1.Condition {
2389- Type : mantlev1 .BackupConditionReadyToUse ,
2389+ Type : mantlev1 .BackupConditionSnapshotCaptured ,
23902390 Status : metav1 .ConditionTrue ,
2391- Reason : mantlev1 .ConditionReasonReadyToUseNoProblem ,
2391+ Reason : mantlev1 .ConditionReasonSnapshotCapturedNoProblem ,
23922392 })
23932393 return nil
23942394 }); err != nil {
0 commit comments