summaryrefslogtreecommitdiff
path: root/registry/service.go
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2022-02-26 13:04:15 +0100
committerSebastiaan van Stijn <github@gone.nl>2022-03-17 17:09:15 +0100
commit98202c86adb4ee697bb2ff5c6d72ab373ab2a0f6 (patch)
tree10a0be16b055313078e29d97fb1d14f706d696ca /registry/service.go
parent273dca4e3c997f45739c0a6be94fb241efc30a1c (diff)
downloaddocker-98202c86adb4ee697bb2ff5c6d72ab373ab2a0f6.tar.gz
registry: remove ErrInvalidRepositoryName
This error was only returned in a single location, and not used anywhere as a specific type. The error returned by `validateNoScheme()` also appeared to only be used in one case; in all other cases, the error itself was ignored, and replaced with a custom error. Because of this, this patch also replace `validateNoScheme()` with a `hasScheme()` function that returns a boolean, to better match how it's used. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'registry/service.go')
-rw-r--r--registry/service.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/registry/service.go b/registry/service.go
index a8ea446e37..ea2fb35c14 100644
--- a/registry/service.go
+++ b/registry/service.go
@@ -161,8 +161,8 @@ func splitReposSearchTerm(reposName string) (string, string) {
// search terms, and returns the results.
func (s *defaultService) Search(ctx context.Context, term string, limit int, authConfig *types.AuthConfig, userAgent string, headers map[string][]string) (*registrytypes.SearchResults, error) {
// TODO Use ctx when searching for repositories
- if err := validateNoScheme(term); err != nil {
- return nil, err
+ if hasScheme(term) {
+ return nil, errors.New(`invalid repository name (ex: "registry.domain.tld/myrepos")`)
}
indexName, remoteName := splitReposSearchTerm(term)