Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to go.mod #3058

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
OS: linux
ARCH: amd64
GOVERSION: 1.17
GO111MODULE: "off"
GO111MODULE: "on"
# Needed to install protoc
PROTOC_VERSION: 3.6.1

Expand Down Expand Up @@ -77,7 +77,6 @@ jobs:
environment:
# ensure GOPATH is set to single directory so the make target doesn't need to handle a column-separated list
GOPATH: /home/circleci/.go_workspace
GO111MODULE: "on"
command: |
git fetch origin
if test -n "`git diff --stat=1000 origin/master | grep -E \"^[[:space:]]*vendor\"`"; then
Expand Down
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,3 @@ bin/swarmkitstate

# dev sync, if used
/.docker-sync/

# top-level go.mod is not meant to be checked in yet
/go.mod
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ for details.

### Update vendored dependencies

To update dependency you need just change `vendor.mod` file and run:
To update dependency you need just change `go.mod` file and run:
```
make go-mod-vendor
```
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN curl --silent --show-error --location --output protoc.zip \
&& unzip -d /usr/local protoc.zip include/\* bin/\* \
&& rm -f protoc.zip

ENV GO111MODULE=off
ENV GO111MODULE=on
WORKDIR /go/src/github.com/docker/swarmkit/

# install the dependencies from `make setup`
Expand Down
20 changes: 10 additions & 10 deletions api/api.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2735,8 +2735,8 @@ file {
label: LABEL_OPTIONAL
type: TYPE_UINT32
options {
65001: 0
65003: "os.FileMode"
65001: 0
}
json_name: "mode"
}
Expand Down Expand Up @@ -2904,8 +2904,8 @@ file {
type: TYPE_MESSAGE
type_name: ".google.protobuf.Duration"
options {
65001: 0
65011: 1
65001: 0
}
json_name: "delay"
}
Expand Down Expand Up @@ -3348,8 +3348,8 @@ file {
}
}
options {
62001: 0
62023: "PublishMode"
62001: 0
}
}
}
Expand Down Expand Up @@ -4055,8 +4055,8 @@ file {
label: LABEL_OPTIONAL
type: TYPE_UINT32
options {
65001: 0
65003: "os.FileMode"
65001: 0
}
json_name: "mode"
}
Expand Down Expand Up @@ -5052,8 +5052,8 @@ file {
}
}
options {
62001: 0
62023: "NodeRole"
62001: 0
}
}
syntax: "proto3"
Expand Down Expand Up @@ -9739,8 +9739,8 @@ file {
type: TYPE_MESSAGE
type_name: ".google.protobuf.Duration"
options {
65001: 0
65011: 1
65001: 0
}
json_name: "period"
}
Expand Down Expand Up @@ -10958,14 +10958,14 @@ file {
}
}
options {
63001: 0
63002: 0
63017: 1
63018: 1
63020: 1
63018: 1
63001: 0
63002: 0
63035: 0
63026: 0
63034: 0
63035: 0
}
}
file {
Expand Down
16 changes: 6 additions & 10 deletions direct.mk
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,15 @@ help: ## this help
.PHONY: dep-validate
dep-validate: go-mod-vendor
@echo "+ $@"
@go mod tidy -modfile vendor.mod
@git diff --exit-code vendor.mod vendor.sum vendor || \
(echo >&2 "+ inconsistent dependencies! what you have in vendor.mod does not match with what you have in vendor" && false)

go.mod:
@printf "module github.com/docker/swarmkit\n\ngo 1.17\n" > $@

@go mod tidy
@git diff --exit-code go.mod go.sum vendor || \
(echo >&2 "+ inconsistent dependencies! what you have in go.mod does not match with what you have in vendor" && false)

.PHONY: go-mod-vendor
go-mod-vendor: go.mod
@go mod vendor -modfile vendor.mod
go-mod-vendor:
@go mod vendor
@# ensure that key protobuf spec files are in vendor dir
@module=github.com/gogo/protobuf ; \
prefix=$$(go env GOPATH)/pkg/mod/$${module} ; \
version=$$(go list -modfile vendor.mod -m -f '{{.Version}}' $${module}) ; \
version=$$(go list -m -f '{{.Version}}' $${module}) ; \
cp -a $${prefix}@$${version}/protobuf vendor/$${module}/ && chmod -R u+w vendor/$${module}
15 changes: 7 additions & 8 deletions vendor.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// 'vendor.mod' enables use of 'go mod vendor' to managed 'vendor/' directory.
// There is no 'go.mod' file, as that would imply opting in for all the rules
// around SemVer. Switch over may occur in the future, but presently the goal
// is to just use 'go mod vendor' here and other projects including moby.

module github.com/docker/swarmkit

go 1.17

retract (
v1.12.1 // Contains retractions only.
v1.12.0 // Not intended as a Swarmkit release.
)

require (
code.cloudfoundry.org/clock v1.0.0
github.com/Microsoft/go-winio v0.4.17
github.com/akutz/memconn v0.1.0
github.com/cloudflare/cfssl v0.0.0-20180323000720-5d63dbd981b5
github.com/container-storage-interface/spec v1.2.0
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v20.10.3-0.20220126110425-3c06ebd87668+incompatible
github.com/docker/docker v20.10.3-0.20220408103430-7ea283fd9166+incompatible // v22.04 dev
github.com/docker/go-connections v0.4.0
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
github.com/docker/go-metrics v0.0.1
Expand Down Expand Up @@ -60,7 +60,6 @@ require (
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 // indirect
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158 // indirect
github.com/containerd/containerd v1.5.9 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
Expand All @@ -77,7 +76,7 @@ require (
github.com/google/btree v1.0.1 // indirect
github.com/google/certificate-transparency-go v1.1.2 // indirect
github.com/google/trillian v1.4.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
Expand Down
Loading