@@ -1297,10 +1297,6 @@ func waitForDRComponent(ctx context.Context, drComponent disasterRecoveryCompone
12971297// restoreFromReplicatedBackup restores a disaster recovery component from a backup.
12981298func restoreFromReplicatedBackup (ctx context.Context , backup disasterrecovery.ReplicatedBackup , drComponent disasterRecoveryComponent ) error {
12991299 if drComponent == disasterRecoveryComponentApp {
1300- b := backup .GetAppBackup ()
1301- if b == nil {
1302- return fmt .Errorf ("unable to find app backup" )
1303- }
13041300 isImprovedDR , err := usesImprovedDR ()
13051301 if err != nil {
13061302 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
13091305 // the vendor. Otherwise, we use the "replicated.com/disaster-recovery" label to discover
13101306 // the application resources in the cluster.
13111307 if isImprovedDR {
1308+ b := backup .GetAppBackup ()
1309+ if b == nil {
1310+ return fmt .Errorf ("unable to find app backup" )
1311+ }
13121312 r , err := backup .GetRestore ()
13131313 if err != nil {
13141314 return fmt .Errorf ("failed to get restore resource from backup: %w" , err )
@@ -1317,11 +1317,7 @@ func restoreFromReplicatedBackup(ctx context.Context, backup disasterrecovery.Re
13171317 if err != nil {
13181318 return fmt .Errorf ("failed to restore app from backup: %w" , err )
13191319 }
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
13251321 }
13261322 }
13271323 b := backup .GetInfraBackup ()
0 commit comments