mirror of
https://github.com/containers/skopeo.git
synced 2025-09-14 13:59:44 +00:00
Vendor after merging in mtrmac/image:docker-lookaside
This commit is contained in:
8
vendor/github.com/docker/distribution/reference/reference.go
generated
vendored
8
vendor/github.com/docker/distribution/reference/reference.go
generated
vendored
@@ -24,6 +24,7 @@ package reference
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/distribution/digest"
|
||||
)
|
||||
@@ -43,6 +44,9 @@ var (
|
||||
// ErrDigestInvalidFormat represents an error while trying to parse a string as a tag.
|
||||
ErrDigestInvalidFormat = errors.New("invalid digest format")
|
||||
|
||||
// ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters.
|
||||
ErrNameContainsUppercase = errors.New("repository name must be lowercase")
|
||||
|
||||
// ErrNameEmpty is returned for empty, invalid repository names.
|
||||
ErrNameEmpty = errors.New("repository name must have at least one component")
|
||||
|
||||
@@ -149,7 +153,9 @@ func Parse(s string) (Reference, error) {
|
||||
if s == "" {
|
||||
return nil, ErrNameEmpty
|
||||
}
|
||||
// TODO(dmcgowan): Provide more specific and helpful error
|
||||
if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil {
|
||||
return nil, ErrNameContainsUppercase
|
||||
}
|
||||
return nil, ErrReferenceInvalidFormat
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user