Skip to content

Commit

Permalink
fix: restore mongo crash (#7662)
Browse files Browse the repository at this point in the history
(cherry picked from commit 95bf118)
  • Loading branch information
wangyelei committed Jun 28, 2024
1 parent 68f34b5 commit 83f6ab6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/controller/plan/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ func (r *RestoreManager) DoPrepareData(comp *component.SynthesizedComponent,
if err != nil {
return err
}
restores = append(restores, restore)
if restore != nil {
restores = append(restores, restore)
}
}
compReplicas := comp.Replicas - templateReplicas
if compReplicas > 0 {
Expand All @@ -137,7 +139,9 @@ func (r *RestoreManager) DoPrepareData(comp *component.SynthesizedComponent,
if err != nil {
return err
}
restores = append(restores, restore)
if restore != nil {
restores = append(restores, restore)
}
}
return r.createRestoreAndWait(compObj, restores...)
}
Expand Down

0 comments on commit 83f6ab6

Please sign in to comment.