Skip to content

Commit

Permalink
Merge pull request #8201 from QiWang19/search-limit
Browse files Browse the repository at this point in the history
Remove search limit since pagination support
  • Loading branch information
openshift-merge-robot authored Oct 30, 2020
2 parents d475c99 + cab33cf commit e5227b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions cmd/podman/images/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ func imageSearch(cmd *cobra.Command, args []string) error {
return errors.Errorf("search requires exactly one argument")
}

if searchOptions.Limit > 100 {
return errors.Errorf("Limit %d is outside the range of [1, 100]", searchOptions.Limit)
}

if searchOptions.ListTags && len(searchOptions.Filters) != 0 {
return errors.Errorf("filters are not applicable to list tags result")
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-search.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Note: use .Tag only if the --list-tags is set.

**--limit**=*limit*

Limit the number of results. This value can be in the range between 1 and 100. The default number of results is 25.
Limit the number of results (default 25).
Note: The results from each registry will be limited to this value.
Example if limit is 10 and two registries are being searched, the total
number of results will be 20, 10 from each (if there are at least 10 matches in each).
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,4 +460,11 @@ registries = ['{{.Host}}:{{.Port}}']`
search.WaitWithDefaultTimeout()
Expect(len(search.OutputToStringArray()) == 0).To(BeTrue())
})

It("podman search with limit over 100", func() {
search := podmanTest.Podman([]string{"search", "--limit", "130", "registry.redhat.io/rhel"})
search.WaitWithDefaultTimeout()
Expect(search.ExitCode()).To(Equal(0))
Expect(len(search.OutputToStringArray())).To(Equal(131))
})
})

0 comments on commit e5227b9

Please sign in to comment.