summaryrefslogtreecommitdiff
path: root/registry/service.go
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2022-03-02 13:29:47 +0100
committerSebastiaan van Stijn <github@gone.nl>2022-03-18 09:41:56 +0100
commita5be5801e98d8bab261d6fd29953d3ecf452df7a (patch)
treec7a3038ef1c6d873be84dbf7fdf28fb831108e09 /registry/service.go
parent7cba4ffa30466156b0915e9effe0a5d8c085e75e (diff)
downloaddocker-a5be5801e98d8bab261d6fd29953d3ecf452df7a.tar.gz
search: un-export registry.DefaultSearchLimit, and fix API status codes
Move the default to the service itself, and produce the correct status code if an invalid limit was specified. The default is currently set both on the cli and on the daemon side, and it should be only set on one of them. There is a slight change in behavior; previously, searching with `--limit=0` would produce an error, but with this change, it's considered the equivalent of "no limit set" (and using the default). We could keep the old behavior by passing a pointer (`nil` means "not set"), but I left that for a follow-up exercise (we may want to pass an actual config instead of separate arguments, as well as some other things that need cleaning up). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'registry/service.go')
-rw-r--r--registry/service.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/registry/service.go b/registry/service.go
index 0cda3a8806..4b38349de6 100644
--- a/registry/service.go
+++ b/registry/service.go
@@ -16,11 +16,6 @@ import (
"github.com/sirupsen/logrus"
)
-const (
- // DefaultSearchLimit is the default value for maximum number of returned search results.
- DefaultSearchLimit = 25
-)
-
// Service is the interface defining what a registry service should implement.
type Service interface {
Auth(ctx context.Context, authConfig *types.AuthConfig, userAgent string) (status, token string, err error)