Update to provide small and clear interfaces

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2015-09-08 16:00:48 -07:00
parent b72f1fd2e3
commit 582a0661bf
6 changed files with 26 additions and 18 deletions

View file

@ -108,7 +108,7 @@ func (reg *registry) Scope() distribution.Scope {
// Instances should not be shared between goroutines but are cheap to
// allocate. In general, they should be request scoped.
func (reg *registry) Repository(ctx context.Context, canonicalName string) (distribution.Repository, error) {
if _, err := reference.NewRepository(canonicalName); err != nil {
if _, err := reference.ParseNamed(canonicalName); err != nil {
return nil, distribution.ErrRepositoryNameInvalid{
Name: canonicalName,
Reason: err,