List pages of resource groups if entire list is not fetch in first page

This commit is contained in:
Guillaume Tardif 2020-06-22 15:34:13 +02:00
parent f931ba3fca
commit aeb6d2c7c6
1 changed files with 10 additions and 0 deletions

View File

@ -65,6 +65,16 @@ func (mgt aciResourceGroupHelperImpl) ListGroups(ctx context.Context, subscripti
}
groups := groupResponse.Values()
for groupResponse.NotDone() {
err = groupResponse.NextWithContext(ctx)
if err != nil {
return nil, err
}
newValues := groupResponse.Values()
groups = append(groups, newValues...)
}
return groups, nil
}