Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 5448f58

Browse files
committed
Fix Pagination for list StackResources
The api does not support marker based pagination and this breaks the clients which loop infinitely over list resource calls.
1 parent 1d8b6f1 commit 5448f58

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

openstack/orchestration/v1/stackresources/requests.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ type ListOptsBuilder interface {
2525
// ListOpts allows the filtering and sorting of paginated collections through
2626
// the API. Marker and Limit are used for pagination.
2727
type ListOpts struct {
28-
// The stack resource ID with which to start the listing.
29-
Marker string `q:"marker"`
30-
31-
// Integer value for the limit of values to return.
32-
Limit int `q:"limit"`
33-
3428
// Include resources from nest stacks up to Depth levels of recursion.
3529
Depth int `q:"nested_depth"`
3630
}
@@ -57,9 +51,7 @@ func List(client *gophercloud.ServiceClient, stackName, stackID string, opts Lis
5751
}
5852

5953
createPageFn := func(r pagination.PageResult) pagination.Page {
60-
p := ResourcePage{pagination.MarkerPageBase{PageResult: r}}
61-
p.MarkerPageBase.Owner = p
62-
return p
54+
return ResourcePage{pagination.SinglePageBase(r)}
6355
}
6456

6557
return pagination.NewPager(client, url, createPageFn)

openstack/orchestration/v1/stackresources/results.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (r FindResult) Extract() ([]Resource, error) {
6363
// As OpenStack extensions may freely alter the response bodies of structures returned to the client, you may only safely access the
6464
// data provided through the ExtractResources call.
6565
type ResourcePage struct {
66-
pagination.MarkerPageBase
66+
pagination.SinglePageBase
6767
}
6868

6969
// IsEmpty returns true if a page contains no Server results.

0 commit comments

Comments
 (0)