@@ -1297,10 +1297,6 @@ func waitForDRComponent(ctx context.Context, drComponent disasterRecoveryCompone
1297
1297
// restoreFromReplicatedBackup restores a disaster recovery component from a backup.
1298
1298
func restoreFromReplicatedBackup (ctx context.Context , backup disasterrecovery.ReplicatedBackup , drComponent disasterRecoveryComponent ) error {
1299
1299
if drComponent == disasterRecoveryComponentApp {
1300
- b := backup .GetAppBackup ()
1301
- if b == nil {
1302
- return fmt .Errorf ("unable to find app backup" )
1303
- }
1304
1300
isImprovedDR , err := usesImprovedDR ()
1305
1301
if err != nil {
1306
1302
return fmt .Errorf ("failed to check if improved dr is enabled: %w" , err )
@@ -1309,6 +1305,10 @@ func restoreFromReplicatedBackup(ctx context.Context, backup disasterrecovery.Re
1309
1305
// the vendor. Otherwise, we use the "replicated.com/disaster-recovery" label to discover
1310
1306
// the application resources in the cluster.
1311
1307
if isImprovedDR {
1308
+ b := backup .GetAppBackup ()
1309
+ if b == nil {
1310
+ return fmt .Errorf ("unable to find app backup" )
1311
+ }
1312
1312
r , err := backup .GetRestore ()
1313
1313
if err != nil {
1314
1314
return fmt .Errorf ("failed to get restore resource from backup: %w" , err )
@@ -1317,11 +1317,7 @@ func restoreFromReplicatedBackup(ctx context.Context, backup disasterrecovery.Re
1317
1317
if err != nil {
1318
1318
return fmt .Errorf ("failed to restore app from backup: %w" , err )
1319
1319
}
1320
- } else {
1321
- err = restoreFromBackup (ctx , b , drComponent )
1322
- if err != nil {
1323
- return fmt .Errorf ("failed to restore app from backup: %w" , err )
1324
- }
1320
+ return nil
1325
1321
}
1326
1322
}
1327
1323
b := backup .GetInfraBackup ()
0 commit comments