Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ListVolumes paging #310

Merged
merged 4 commits into from
May 2, 2020
Merged

Fix ListVolumes paging #310

merged 4 commits into from
May 2, 2020

Conversation

timoreimann
Copy link
Collaborator

@timoreimann timoreimann commented May 1, 2020

Previously, the ListVolumes implementation would ignore the starting token and max entries value from the request parameter, thereby effectively not using paging. This change provides a fix by refactoring the existing implementation for ListSnapshots into a reusable helper method and using it from both List* implementations.

#300 introduced the fixed paging method for ListSnapshots.

@timoreimann timoreimann marked this pull request as ready for review May 1, 2020 13:22
if err != nil {
return nil, err
untypedVolumes := make([]interface{}, 0, len(volumes))
for _, snap := range volumes {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little confused by the use of snap here, it looks like we later cast to a godo.Volume. I'm guessing it's just a copy pasta error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes indeed -- good catch, it's fixed now.

@timoreimann timoreimann merged commit 8cc7756 into master May 2, 2020
@timoreimann timoreimann deleted the fix-listvolumes-paging branch May 2, 2020 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants