Merge pull request #27774 from runcom/vendor-distr · SourceCode/docker@4e6cb66 · GitHub
Skip to content

Commit 4e6cb66

Browse files
authored
Merge pull request moby#27774 from runcom/vendor-distr
vendor docker/distribution fbb70dc3a14ca65cdac3aaf5e5122b03b42f6fbc
2 parents 3a3a87b + 78a429a commit 4e6cb66

14 files changed

Lines changed: 143 additions & 63 deletions

File tree

hack/vendor.sh

Lines changed: 1 addition & 1 deletion

vendor/src/github.com/docker/distribution/BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Most people should use the [official Registry docker image](https://hub.docker.c
1111

1212
People looking for advanced operational use cases might consider rolling their own image with a custom Dockerfile inheriting `FROM registry:2`.
1313

14-
OS X users who want to run natively can do so following [the instructions here](osx-setup-guide.md).
14+
OS X users who want to run natively can do so following [the instructions here](https://github.com/docker/docker.github.io/blob/master/registry/recipes/osx-setup-guide.md).
1515

1616
### Gotchas
1717

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Only run on Linux atm
2+
wrappedNode(label: 'docker') {
3+
deleteDir()
4+
stage "checkout"
5+
checkout scm
6+
7+
documentationChecker("docs")
8+
}

vendor/src/github.com/docker/distribution/Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,25 @@ version/version.go:
2727
# Required for go 1.5 to build
2828
GO15VENDOREXPERIMENT := 1
2929

30+
# Go files
31+
GOFILES=$(shell find . -type f -name '*.go')
32+
3033
# Package list
31-
PKGS := $(shell go list -tags "${DOCKER_BUILDTAGS}" ./... | grep -v ^github.com/docker/distribution/vendor/)
34+
PKGS=$(shell go list -tags "${DOCKER_BUILDTAGS}" ./... | grep -v ^github.com/docker/distribution/vendor/)
3235

3336
# Resolving binary dependencies for specific targets
34-
GOLINT := $(shell which golint || echo '')
35-
GODEP := $(shell which godep || echo '')
37+
GOLINT=$(shell which golint || echo '')
38+
GODEP=$(shell which godep || echo '')
3639

37-
${PREFIX}/bin/registry: $(wildcard **/*.go)
40+
${PREFIX}/bin/registry: $(GOFILES)
3841
@echo "+ $@"
3942
@go build -tags "${DOCKER_BUILDTAGS}" -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/registry
4043

41-
${PREFIX}/bin/digest: $(wildcard **/*.go)
44+
${PREFIX}/bin/digest: $(GOFILES)
4245
@echo "+ $@"
4346
@go build -tags "${DOCKER_BUILDTAGS}" -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/digest
4447

45-
${PREFIX}/bin/registry-api-descriptor-template: $(wildcard **/*.go)
48+
${PREFIX}/bin/registry-api-descriptor-template: $(GOFILES)
4649
@echo "+ $@"
4750
@go build -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/registry-api-descriptor-template
4851

vendor/src/github.com/docker/distribution/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This repository contains the following components:
1919
| **registry** | An implementation of the [Docker Registry HTTP API V2](docs/spec/api.md) for use with docker 1.6+. |
2020
| **libraries** | A rich set of libraries for interacting with distribution components. Please see [godoc](https://godoc.org/github.com/docker/distribution) for details. **Note**: These libraries are **unstable**. |
2121
| **specifications** | _Distribution_ related specifications are available in [docs/spec](docs/spec) |
22-
| **documentation** | Docker's full documentation set is available at [docs.docker.com](https://docs.docker.com). This repository [contains the subset](docs/index.md) related just to the registry. |
22+
| **documentation** | Docker's full documentation set is available at [docs.docker.com](https://docs.docker.com). This repository [contains the subset](docs/) related just to the registry. |
2323

2424
### How does this integrate with Docker engine?
2525

@@ -60,15 +60,15 @@ For information on upcoming functionality, please see [ROADMAP.md](ROADMAP.md).
6060
By default, Docker users pull images from Docker's public registry instance.
6161
[Installing Docker](https://docs.docker.com/engine/installation/) gives users this
6262
ability. Users can also push images to a repository on Docker's public registry,
63-
if they have a [Docker Hub](https://hub.docker.com/) account.
63+
if they have a [Docker Hub](https://hub.docker.com/) account.
6464

6565
For some users and even companies, this default behavior is sufficient. For
66-
others, it is not.
66+
others, it is not.
6767

6868
For example, users with their own software products may want to maintain a
6969
registry for private, company images. Also, you may wish to deploy your own
7070
image repository for images used to test or in continuous integration. For these
71-
use cases and others, [deploying your own registry instance](docs/deploying.md)
71+
use cases and others, [deploying your own registry instance](https://github.com/docker/docker.github.io/blob/master/registry/deploying.md)
7272
may be the better choice.
7373

7474
### Migration to Registry 2.0
@@ -83,7 +83,7 @@ created. For more information see [docker/migrator]
8383

8484
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute
8585
issues, fixes, and patches to this project. If you are contributing code, see
86-
the instructions for [building a development environment](docs/recipes/building.md).
86+
the instructions for [building a development environment](BUILDING.md).
8787

8888
## Support
8989

vendor/src/github.com/docker/distribution/manifest/schema1/config_builder.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ import (
99

1010
"github.com/docker/distribution"
1111
"github.com/docker/distribution/context"
12-
"github.com/docker/distribution/reference"
13-
"github.com/docker/libtrust"
14-
1512
"github.com/docker/distribution/digest"
1613
"github.com/docker/distribution/manifest"
14+
"github.com/docker/distribution/reference"
15+
"github.com/docker/libtrust"
1716
)
1817

1918
type diffID digest.Digest
@@ -95,7 +94,7 @@ func (mb *configManifestBuilder) Build(ctx context.Context) (m distribution.Mani
9594
}
9695

9796
if len(img.RootFS.DiffIDs) != len(mb.descriptors) {
98-
return nil, errors.New("number of descriptors and number of layers in rootfs must match")
97+
return nil, fmt.Errorf("number of descriptors and number of layers in rootfs must match: len(%v) != len(%v)", img.RootFS.DiffIDs, mb.descriptors)
9998
}
10099

101100
// Generate IDs for each layer

vendor/src/github.com/docker/distribution/manifest/schema2/manifest.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const (
1818
MediaTypeConfig = "application/vnd.docker.container.image.v1+json"
1919

2020
// MediaTypePluginConfig specifies the mediaType for plugin configuration.
21-
MediaTypePluginConfig = "application/vnd.docker.plugin.v0+json"
21+
MediaTypePluginConfig = "application/vnd.docker.plugin.image.v0+json"
2222

2323
// MediaTypeLayer is the mediaType used for layers referenced by the
2424
// manifest.
@@ -69,7 +69,10 @@ type Manifest struct {
6969

7070
// References returnes the descriptors of this manifests references.
7171
func (m Manifest) References() []distribution.Descriptor {
72-
return m.Layers
72+
references := make([]distribution.Descriptor, 0, 1+len(m.Layers))
73+
references = append(references, m.Config)
74+
references = append(references, m.Layers...)
75+
return references
7376
}
7477

7578
// Target returns the target of this signed manifest.

vendor/src/github.com/docker/distribution/manifests.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ import (
1212
// references and an optional target
1313
type Manifest interface {
1414
// References returns a list of objects which make up this manifest.
15-
// The references are strictly ordered from base to head. A reference
16-
// is anything which can be represented by a distribution.Descriptor
15+
// A reference is anything which can be represented by a
16+
// distribution.Descriptor. These can consist of layers, resources or other
17+
// manifests.
18+
//
19+
// While no particular order is required, implementations should return
20+
// them from highest to lowest priority. For example, one might want to
21+
// return the base layer before the top layer.
1722
References() []Descriptor
1823

1924
// Payload provides the serialized format of the manifest, in addition to
@@ -36,6 +41,9 @@ type ManifestBuilder interface {
3641
// AppendReference includes the given object in the manifest after any
3742
// existing dependencies. If the add fails, such as when adding an
3843
// unsupported dependency, an error may be returned.
44+
//
45+
// The destination of the reference is dependent on the manifest type and
46+
// the dependency type.
3947
AppendReference(dependency Describable) error
4048
}
4149

vendor/src/github.com/docker/distribution/reference/reference.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ package reference
2424
import (
2525
"errors"
2626
"fmt"
27+
"strings"
2728

2829
"github.com/docker/distribution/digest"
2930
)
@@ -43,6 +44,9 @@ var (
4344
// ErrDigestInvalidFormat represents an error while trying to parse a string as a tag.
4445
ErrDigestInvalidFormat = errors.New("invalid digest format")
4546

47+
// ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters.
48+
ErrNameContainsUppercase = errors.New("repository name must be lowercase")
49+
4650
// ErrNameEmpty is returned for empty, invalid repository names.
4751
ErrNameEmpty = errors.New("repository name must have at least one component")
4852

@@ -134,7 +138,7 @@ type Canonical interface {
134138
func SplitHostname(named Named) (string, string) {
135139
name := named.Name()
136140
match := anchoredNameRegexp.FindStringSubmatch(name)
137-
if match == nil || len(match) != 3 {
141+
if len(match) != 3 {
138142
return "", name
139143
}
140144
return match[1], match[2]
@@ -149,7 +153,9 @@ func Parse(s string) (Reference, error) {
149153
if s == "" {
150154
return nil, ErrNameEmpty
151155
}
152-
// TODO(dmcgowan): Provide more specific and helpful error
156+
if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil {
157+
return nil, ErrNameContainsUppercase
158+
}
153159
return nil, ErrReferenceInvalidFormat
154160
}
155161

Lines changed: 27 additions & 0 deletions

0 commit comments

Comments
 (0)