Skip to content

Commit

Permalink
Merge pull request #85 from rancherfederal/fix-list-paging
Browse files Browse the repository at this point in the history
Fix list request to registry to properly page
  • Loading branch information
joshrwolf authored Dec 2, 2021
2 parents de366c7 + dc02554 commit f324078
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"net/http"
"net/http/httptest"
"regexp"
"strconv"
"time"

"github.com/distribution/distribution/v3/configuration"
Expand Down Expand Up @@ -93,7 +92,9 @@ func (s *Store) List(ctx context.Context) ([]string, error) {
for {
chunk := make([]string, 20) // randomly chosen number...
nf, err := reg.Repositories(ctx, chunk, last)
last = strconv.Itoa(nf)
if nf > 0 {
last = chunk[nf-1]
}

for _, e := range chunk {
if e == "" {
Expand Down

0 comments on commit f324078

Please sign in to comment.