Skip to content

Commit

Permalink
Fix gcrane top-level listing (#1005)
Browse files Browse the repository at this point in the history
Accidentally dropped top-level repo listing in gcrane for paginating
responses.
  • Loading branch information
jonjohnsonjr authored Apr 28, 2021
1 parent dff71aa commit 5a37827
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/v1/google/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (l *lister) list(repo name.Repository) (*Tags, error) {
return nil, err
}

if len(parsed.Manifests) != 0 {
if len(parsed.Manifests) != 0 || len(parsed.Children) != 0 {
// We're dealing with GCR, just return directly.
return &parsed, nil
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/v1/google/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ func TestList(t *testing.T) {
},
Tags: []string{"foo", "bar", "baz"},
},
}, {
name: "just children",
responseBody: []byte(`{"child":["hello", "world"]}`),
wantErr: false,
wantTags: &Tags{
Children: []string{"hello", "world"},
},
}, {
name: "not json",
responseBody: []byte("notjson"),
Expand Down

0 comments on commit 5a37827

Please sign in to comment.