Skip to content

Commit 74b8bcc

Browse files
committed
go.mod: cut circular dependency on github.com/containerd/containerd
This forces vendoring to only take dependencies of this repository to be taken into account, effectively cutting the circular dependency (for the vendored code), and to prevent depending on transitive dependencies coming from older versions of containerd. go mod does not allow using the main module as a local "replace" rule using a path; see golang/go#45492 and golang/go#34417, so instead, an empty module is used. One change observed is that older versions containerd depended on an older version of imgcrypt that had an "indirect" dependency on more current versions of gopkg.in/yaml.v2 and prometheus/procfs. For those, a temporary "indirect" dependency was added, until prometheus/client_golang and kubernetes are updated. from go mod graph (before): github.com/containerd/[email protected] gopkg.in/[email protected] github.com/containerd/[email protected] github.com/prometheus/[email protected] For some reason, some older versions of containerd are still taken into account, causing satori/go.uuid to be added as "indirect" dependency, likely because some modules have this dependency in their go.sum. This should likely disappear once those plugins are updated to contain a current version of containerd. git grep 'github.com/satori/go.uuid' vendor/github.com/Microsoft/hcsshim/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= vendor/github.com/containerd/aufs/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= vendor/github.com/containerd/imgcrypt/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= vendor/github.com/containerd/nri/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= vendor/github.com/containerd/zfs/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= Signed-off-by: Sebastiaan van Stijn <[email protected]> (cherry picked from commit 6f72ef3) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 486d3f5 commit 74b8bcc

File tree

2 files changed

+6
-198
lines changed

2 files changed

+6
-198
lines changed

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ require (
4646
github.com/pelletier/go-toml v1.8.1
4747
github.com/pkg/errors v0.9.1
4848
github.com/prometheus/client_golang v1.7.1
49+
github.com/prometheus/procfs v0.6.0 // indirect; temporarily force v0.6.0, which was previously defined in imgcrypt as explicit version
50+
github.com/satori/go.uuid v1.2.0 // indirect
4951
github.com/sirupsen/logrus v1.7.0
5052
github.com/stretchr/testify v1.6.1
5153
github.com/tchap/go-patricia v2.2.6+incompatible
@@ -68,6 +70,9 @@ require (
6870

6971
// When updating replace rules, make sure to also update the rules in integration/client/go.mod
7072
replace (
73+
// prevent transitional dependencies due to containerd having a circular
74+
// dependency on itself through plugins. see .empty-mod/go.mod for details
75+
github.com/containerd/containerd => ./.empty-mod/
7176
github.com/gogo/googleapis => github.com/gogo/googleapis v1.3.2
7277
github.com/golang/protobuf => github.com/golang/protobuf v1.3.5
7378
// urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092

0 commit comments

Comments
 (0)