Merge pull request #534 from liggitt/respository_typo
Fix typo: respository->repository
This commit is contained in:
commit
36d4e365aa
6 changed files with 8 additions and 8 deletions
|
@ -14,7 +14,7 @@ type ErrRepositoryUnknown struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (err ErrRepositoryUnknown) Error() string {
|
func (err ErrRepositoryUnknown) Error() string {
|
||||||
return fmt.Sprintf("unknown respository name=%s", err.Name)
|
return fmt.Sprintf("unknown repository name=%s", err.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrRepositoryNameInvalid should be used to denote an invalid repository
|
// ErrRepositoryNameInvalid should be used to denote an invalid repository
|
||||||
|
|
|
@ -46,7 +46,7 @@ var (
|
||||||
// ErrRepositoryNameComponentShort is returned when a repository name
|
// ErrRepositoryNameComponentShort is returned when a repository name
|
||||||
// contains a component which is shorter than
|
// contains a component which is shorter than
|
||||||
// RepositoryNameComponentMinLength
|
// RepositoryNameComponentMinLength
|
||||||
ErrRepositoryNameComponentShort = fmt.Errorf("respository name component must be %v or more characters", RepositoryNameComponentMinLength)
|
ErrRepositoryNameComponentShort = fmt.Errorf("repository name component must be %v or more characters", RepositoryNameComponentMinLength)
|
||||||
|
|
||||||
// ErrRepositoryNameMissingComponents is returned when a repository name
|
// ErrRepositoryNameMissingComponents is returned when a repository name
|
||||||
// contains fewer than RepositoryNameMinComponents components
|
// contains fewer than RepositoryNameMinComponents components
|
||||||
|
@ -61,7 +61,7 @@ var (
|
||||||
ErrRepositoryNameComponentInvalid = fmt.Errorf("repository name component must match %q", RepositoryNameComponentRegexp.String())
|
ErrRepositoryNameComponentInvalid = fmt.Errorf("repository name component must match %q", RepositoryNameComponentRegexp.String())
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValidateRespositoryName ensures the repository name is valid for use in the
|
// ValidateRepositoryName ensures the repository name is valid for use in the
|
||||||
// registry. This function accepts a superset of what might be accepted by
|
// registry. This function accepts a superset of what might be accepted by
|
||||||
// docker core or docker hub. If the name does not pass validation, an error,
|
// docker core or docker hub. If the name does not pass validation, an error,
|
||||||
// describing the conditions, is returned.
|
// describing the conditions, is returned.
|
||||||
|
@ -75,7 +75,7 @@ var (
|
||||||
//
|
//
|
||||||
// The result of the production, known as the "namespace", should be limited
|
// The result of the production, known as the "namespace", should be limited
|
||||||
// to 255 characters.
|
// to 255 characters.
|
||||||
func ValidateRespositoryName(name string) error {
|
func ValidateRepositoryName(name string) error {
|
||||||
if len(name) > RepositoryNameTotalLengthMax {
|
if len(name) > RepositoryNameTotalLengthMax {
|
||||||
return ErrRepositoryNameLong
|
return ErrRepositoryNameLong
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ func TestRepositoryNameRegexp(t *testing.T) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ValidateRespositoryName(testcase.input); err != testcase.err {
|
if err := ValidateRepositoryName(testcase.input); err != testcase.err {
|
||||||
if testcase.err != nil {
|
if testcase.err != nil {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
failf("unexpected error for invalid repository: got %v, expected %v", err, testcase.err)
|
failf("unexpected error for invalid repository: got %v, expected %v", err, testcase.err)
|
||||||
|
|
2
registry/storage/cache/memory.go
vendored
2
registry/storage/cache/memory.go
vendored
|
@ -25,7 +25,7 @@ func NewInMemoryBlobDescriptorCacheProvider() BlobDescriptorCacheProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (imbdcp *inMemoryBlobDescriptorCacheProvider) RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) {
|
func (imbdcp *inMemoryBlobDescriptorCacheProvider) RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) {
|
||||||
if err := v2.ValidateRespositoryName(repo); err != nil {
|
if err := v2.ValidateRepositoryName(repo); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
registry/storage/cache/redis.go
vendored
2
registry/storage/cache/redis.go
vendored
|
@ -43,7 +43,7 @@ func NewRedisBlobDescriptorCacheProvider(pool *redis.Pool) BlobDescriptorCachePr
|
||||||
|
|
||||||
// RepositoryScoped returns the scoped cache.
|
// RepositoryScoped returns the scoped cache.
|
||||||
func (rbds *redisBlobDescriptorService) RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) {
|
func (rbds *redisBlobDescriptorService) RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) {
|
||||||
if err := v2.ValidateRespositoryName(repo); err != nil {
|
if err := v2.ValidateRepositoryName(repo); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ func (reg *registry) Scope() distribution.Scope {
|
||||||
// Instances should not be shared between goroutines but are cheap to
|
// Instances should not be shared between goroutines but are cheap to
|
||||||
// allocate. In general, they should be request scoped.
|
// allocate. In general, they should be request scoped.
|
||||||
func (reg *registry) Repository(ctx context.Context, name string) (distribution.Repository, error) {
|
func (reg *registry) Repository(ctx context.Context, name string) (distribution.Repository, error) {
|
||||||
if err := v2.ValidateRespositoryName(name); err != nil {
|
if err := v2.ValidateRepositoryName(name); err != nil {
|
||||||
return nil, distribution.ErrRepositoryNameInvalid{
|
return nil, distribution.ErrRepositoryNameInvalid{
|
||||||
Name: name,
|
Name: name,
|
||||||
Reason: err,
|
Reason: err,
|
||||||
|
|
Loading…
Reference in a new issue