Skip to content

Commit 1d33874

Browse files
committed
go.mod: change imports to github.com/distribution/distribution/v3
Go 1.13 and up enforce import paths to be versioned if a project contains a go.mod and has released v2 or up. The current v2.x branches (and releases) do not yet have a go.mod, and therefore are still allowed to be imported with a non-versioned import path (go modules add a `+incompatible` annotation in that case). However, now that this project has a `go.mod` file, incompatible import paths will not be accepted by go modules, and attempting to use code from this repository will fail. This patch uses `v3` for the import-paths (not `v2`), because changing import paths itself is a breaking change, which means that the next release should increment the "major" version to comply with SemVer (as go modules dictate). Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 6200038 commit 1d33874

173 files changed

Lines changed: 527 additions & 527 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v2
2626
with:
27-
path: src/github.com/docker/distribution
27+
path: src/github.com/distribution/distribution
2828
fetch-depth: 50
2929

3030
- name: Set up Go
@@ -39,7 +39,7 @@ jobs:
3939
cd /tmp && go get -u github.com/vbatts/git-validation
4040
4141
- name: Build
42-
working-directory: ./src/github.com/docker/distribution
42+
working-directory: ./src/github.com/distribution/distribution
4343
run: |
4444
DCO_VERBOSITY=-q script/validate/dco
4545
GO111MODULE=on script/setup/install-dev-tools
@@ -52,4 +52,4 @@ jobs:
5252
5353
- uses: codecov/codecov-action@v1
5454
with:
55-
directory: ./src/github.com/docker/distribution
55+
directory: ./src/github.com/distribution/distribution

BUILDING.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ environment.
2929
If a Go development environment is setup, one can use `go get` to install the
3030
`registry` command from the current latest:
3131

32-
go get github.com/docker/distribution/cmd/registry
32+
go get github.com/distribution/distribution/cmd/registry
3333

3434
The above will install the source repository into the `GOPATH`.
3535

@@ -43,17 +43,17 @@ The `registry`
4343
binary can then be run with the following:
4444

4545
$ $GOPATH/bin/registry --version
46-
$GOPATH/bin/registry github.com/docker/distribution v2.0.0-alpha.1+unknown
46+
$GOPATH/bin/registry github.com/distribution/distribution v2.0.0-alpha.1+unknown
4747

4848
> __NOTE:__ While you do not need to use `go get` to checkout the distribution
4949
> project, for these build instructions to work, the project must be checked
5050
> out in the correct location in the `GOPATH`. This should almost always be
51-
> `$GOPATH/src/github.com/docker/distribution`.
51+
> `$GOPATH/src/github.com/distribution/distribution`.
5252
5353
The registry can be run with the default config using the following
5454
incantation:
5555

56-
$ $GOPATH/bin/registry serve $GOPATH/src/github.com/docker/distribution/cmd/registry/config-example.yml
56+
$ $GOPATH/bin/registry serve $GOPATH/src/github.com/distribution/distribution/cmd/registry/config-example.yml
5757
INFO[0000] endpoint local-5003 disabled, skipping app.id=34bbec38-a91a-494a-9a3f-b72f9010081f version=v2.0.0-alpha.1+unknown
5858
INFO[0000] endpoint local-8083 disabled, skipping app.id=34bbec38-a91a-494a-9a3f-b72f9010081f version=v2.0.0-alpha.1+unknown
5959
INFO[0000] listening on :5000 app.id=34bbec38-a91a-494a-9a3f-b72f9010081f version=v2.0.0-alpha.1+unknown
@@ -64,7 +64,7 @@ If it is working, one should see the above log messages.
6464
### Repeatable Builds
6565

6666
For the full development experience, one should `cd` into
67-
`$GOPATH/src/github.com/docker/distribution`. From there, the regular `go`
67+
`$GOPATH/src/github.com/distribution/distribution`. From there, the regular `go`
6868
commands, such as `go test`, should work per package (please see
6969
[Developing](#developing) if they don't work).
7070

@@ -87,20 +87,20 @@ build:
8787
github.com/docker/libtrust
8888
...
8989
github.com/yvasiyarov/gorelic
90-
github.com/docker/distribution/registry/handlers
91-
github.com/docker/distribution/cmd/registry
90+
github.com/distribution/distribution/registry/handlers
91+
github.com/distribution/distribution/cmd/registry
9292
+ test
9393
...
94-
ok github.com/docker/distribution/digest 7.875s
95-
ok github.com/docker/distribution/manifest 0.028s
96-
ok github.com/docker/distribution/notifications 17.322s
97-
? github.com/docker/distribution/registry [no test files]
98-
ok github.com/docker/distribution/registry/api/v2 0.101s
99-
? github.com/docker/distribution/registry/auth [no test files]
100-
ok github.com/docker/distribution/registry/auth/silly 0.011s
94+
ok github.com/distribution/distribution/digest 7.875s
95+
ok github.com/distribution/distribution/manifest 0.028s
96+
ok github.com/distribution/distribution/notifications 17.322s
97+
? github.com/distribution/distribution/registry [no test files]
98+
ok github.com/distribution/distribution/registry/api/v2 0.101s
99+
? github.com/distribution/distribution/registry/auth [no test files]
100+
ok github.com/distribution/distribution/registry/auth/silly 0.011s
101101
...
102-
+ /Users/sday/go/src/github.com/docker/distribution/bin/registry
103-
+ /Users/sday/go/src/github.com/docker/distribution/bin/registry-api-descriptor-template
102+
+ /Users/sday/go/src/github.com/distribution/distribution/bin/registry
103+
+ /Users/sday/go/src/github.com/distribution/distribution/bin/registry-api-descriptor-template
104104
+ binaries
105105

106106
The above provides a repeatable build using the contents of the vendor
@@ -109,7 +109,7 @@ testing and generating tagged binaries. We can verify this worked by running
109109
the registry binary generated in the "./bin" directory:
110110

111111
$ ./bin/registry --version
112-
./bin/registry github.com/docker/distribution v2.0.0-alpha.2-80-g16d8b2c.m
112+
./bin/registry github.com/distribution/distribution v2.0.0-alpha.2-80-g16d8b2c.m
113113

114114
### Optional build tags
115115

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG GO_VERSION=1.13.8
22

33
FROM golang:${GO_VERSION}-alpine3.11 AS build
44

5-
ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution
5+
ENV DISTRIBUTION_DIR /go/src/github.com/distribution/distribution
66
ENV BUILDTAGS include_oss include_gcs
77

88
ARG GOOS=linux
@@ -24,7 +24,7 @@ RUN set -ex \
2424
&& apk add --no-cache ca-certificates
2525

2626
COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml
27-
COPY --from=build /go/src/github.com/docker/distribution/bin/registry /bin/registry
27+
COPY --from=build /go/src/github.com/distribution/distribution/bin/registry /bin/registry
2828
VOLUME ["/var/lib/registry"]
2929
EXPOSE 5000
3030
ENTRYPOINT ["registry"]

GOVERNANCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# docker/distribution Project Governance
1+
# distribution/distribution Project Governance
22

33
Docker distribution abides by the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
44

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ VERSION ?= $(shell git describe --match 'v[0-9]*' --dirty='.m' --always)
66
REVISION ?= $(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
77

88

9-
PKG=github.com/docker/distribution
9+
PKG=github.com/distribution/distribution/v3
1010

1111
# Project packages.
1212
PACKAGES=$(shell go list -tags "${BUILDTAGS}" ./... | grep -v /vendor/)

blobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"net/http"
99
"time"
1010

11-
"github.com/docker/distribution/reference"
11+
"github.com/distribution/distribution/v3/reference"
1212
"github.com/opencontainers/go-digest"
1313
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1414
)

cmd/digest/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"log"
88
"os"
99

10-
"github.com/docker/distribution/version"
10+
"github.com/distribution/distribution/v3/version"
1111
"github.com/opencontainers/go-digest"
1212

1313
_ "crypto/sha256"

cmd/registry-api-descriptor-template/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
"regexp"
2121
"text/template"
2222

23-
"github.com/docker/distribution/registry/api/errcode"
24-
v2 "github.com/docker/distribution/registry/api/v2"
23+
"github.com/distribution/distribution/v3/registry/api/errcode"
24+
v2 "github.com/distribution/distribution/v3/registry/api/v2"
2525
)
2626

2727
var spaceRegex = regexp.MustCompile(`\n\s*`)

cmd/registry/main.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ package main
33
import (
44
_ "net/http/pprof"
55

6-
"github.com/docker/distribution/registry"
7-
_ "github.com/docker/distribution/registry/auth/htpasswd"
8-
_ "github.com/docker/distribution/registry/auth/silly"
9-
_ "github.com/docker/distribution/registry/auth/token"
10-
_ "github.com/docker/distribution/registry/proxy"
11-
_ "github.com/docker/distribution/registry/storage/driver/azure"
12-
_ "github.com/docker/distribution/registry/storage/driver/filesystem"
13-
_ "github.com/docker/distribution/registry/storage/driver/gcs"
14-
_ "github.com/docker/distribution/registry/storage/driver/inmemory"
15-
_ "github.com/docker/distribution/registry/storage/driver/middleware/alicdn"
16-
_ "github.com/docker/distribution/registry/storage/driver/middleware/cloudfront"
17-
_ "github.com/docker/distribution/registry/storage/driver/middleware/redirect"
18-
_ "github.com/docker/distribution/registry/storage/driver/oss"
19-
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
20-
_ "github.com/docker/distribution/registry/storage/driver/swift"
6+
"github.com/distribution/distribution/v3/registry"
7+
_ "github.com/distribution/distribution/v3/registry/auth/htpasswd"
8+
_ "github.com/distribution/distribution/v3/registry/auth/silly"
9+
_ "github.com/distribution/distribution/v3/registry/auth/token"
10+
_ "github.com/distribution/distribution/v3/registry/proxy"
11+
_ "github.com/distribution/distribution/v3/registry/storage/driver/azure"
12+
_ "github.com/distribution/distribution/v3/registry/storage/driver/filesystem"
13+
_ "github.com/distribution/distribution/v3/registry/storage/driver/gcs"
14+
_ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory"
15+
_ "github.com/distribution/distribution/v3/registry/storage/driver/middleware/alicdn"
16+
_ "github.com/distribution/distribution/v3/registry/storage/driver/middleware/cloudfront"
17+
_ "github.com/distribution/distribution/v3/registry/storage/driver/middleware/redirect"
18+
_ "github.com/distribution/distribution/v3/registry/storage/driver/oss"
19+
_ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws"
20+
_ "github.com/distribution/distribution/v3/registry/storage/driver/swift"
2121
)
2222

2323
func main() {

context/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"sync"
66

7-
"github.com/docker/distribution/uuid"
7+
"github.com/distribution/distribution/v3/uuid"
88
)
99

1010
// instanceContext is a context that provides only an instance id. It is
@@ -21,7 +21,7 @@ func (ic *instanceContext) Value(key interface{}) interface{} {
2121
// We want to lazy initialize the UUID such that we don't
2222
// call a random generator from the package initialization
2323
// code. For various reasons random could not be available
24-
// https://github.com/docker/distribution/issues/782
24+
// https://github.com/distribution/distribution/issues/782
2525
ic.id = uuid.Generate().String()
2626
})
2727
return ic.id

0 commit comments

Comments
 (0)