Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gnolong committed Nov 29, 2024
1 parent 0760b09 commit 4b605f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/dataprotection/backup/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (r *Request) buildBackupDataAction(targetPod *corev1.Pod, name string) (act

backupDataAct := r.ActionSet.Spec.Backup.BackupData
switch r.ActionSet.Spec.BackupType {
case dpv1alpha1.BackupTypeFull:
case dpv1alpha1.BackupTypeFull, dpv1alpha1.BackupTypeSelective:
podSpec, err := r.BuildJobActionPodSpec(targetPod, BackupDataContainerName, &backupDataAct.JobActionSpec)
if err != nil {
return nil, fmt.Errorf("failed to build job action pod spec: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/dataprotection/restore/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func ValidateAndInitRestoreMGR(reqCtx intctrlutil.RequestCtx,

// build backupActionSets of prepareData and postReady stage based on the specified backup's type.
switch backupType {
case dpv1alpha1.BackupTypeFull:
case dpv1alpha1.BackupTypeFull, dpv1alpha1.BackupTypeSelective:
restoreMgr.SetBackupSets(*backupSet)
case dpv1alpha1.BackupTypeIncremental:
err = restoreMgr.BuildIncrementalBackupActionSets(reqCtx, cli, *backupSet)
Expand Down
1 change: 1 addition & 0 deletions pkg/testutil/dataprotection/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func MockActionSetWithSchema(testCtx *testutil.TestContext, actionSet *dpv1alpha
}
as.Spec.Backup.WithParameters = []string{ParameterString, ParameterArray}
as.Spec.Restore.WithParameters = []string{ParameterString, ParameterArray}
as.Spec.BackupType = dpv1alpha1.BackupTypeSelective
})).Should(Succeed())
By("the actionSet should be available")
Eventually(testapps.CheckObj(testCtx, client.ObjectKeyFromObject(actionSet),
Expand Down

0 comments on commit 4b605f0

Please sign in to comment.