diff --git a/src/internal/m365/service/groups/restore.go b/src/internal/m365/service/groups/restore.go index d7eb2ef9e..60158bfbd 100644 --- a/src/internal/m365/service/groups/restore.go +++ b/src/internal/m365/service/groups/restore.go @@ -43,6 +43,10 @@ func GetRestoreResource( } if len(rc.ProtectedResource) == 0 { + if len(rc.SubService.ID) == 0 { + return path.UnknownService, nil, errors.New("missing subservice id for restore") + } + pr, err := res.GetResourceIDAndNameFrom(ctx, rc.SubService.ID, ins) if err != nil { return path.UnknownService, nil, clues.Wrap(err, "identifying resource owner") diff --git a/src/internal/operations/test/group_test.go b/src/internal/operations/test/group_test.go index 8706654a2..06c63efc6 100644 --- a/src/internal/operations/test/group_test.go +++ b/src/internal/operations/test/group_test.go @@ -239,5 +239,5 @@ func (suite *GroupsRestoreNightlyIntgSuite) TestRestore_Run_groupsAlternateProte sel.Selector, suite.its.group.RootSite, suite.its.secondaryGroup.RootSite, - suite.its.secondaryGroup.ID) + suite.its.secondaryGroup.RootSite.ID) } diff --git a/src/internal/operations/test/onedrive_test.go b/src/internal/operations/test/onedrive_test.go index 808c4675c..3f8e01d81 100644 --- a/src/internal/operations/test/onedrive_test.go +++ b/src/internal/operations/test/onedrive_test.go @@ -1050,6 +1050,12 @@ func runDriveRestoreWithAdvancedOptions( acd = ac.Drives() ) + // Groups restore needs subservice information + if sel.Service == selectors.ServiceGroups { + restoreCfg.SubService.Type = path.SharePointService + restoreCfg.SubService.ID = driveID + } + // initial restore suite.Run("baseline", func() { @@ -1320,8 +1326,13 @@ func runDriveRestoreToAlternateProtectedResource( acd = ac.Drives() ) - // first restore to the 'from' resource + // Groups restore needs subservice information + if sel.Service == selectors.ServiceGroups { + restoreCfg.SubService.Type = path.SharePointService + restoreCfg.SubService.ID = driveFrom.ID + } + // first restore to the 'from' resource suite.Run("restore original resource", func() { mb = evmock.NewBus() fromCtr := count.New()