Skip to content

Commit d078e30

Browse files
thaJeztahndeloof
authored andcommitted
go.mod: pin k8s dependencies to the same version as in buildx
Buildx uses replace rules to pin these dependencies to the version that's used in buildkit. Newer versions of these dependencies are incompatible with some go versions, and we do not need the newer versions for where it's used. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent b7fd6eb commit d078e30

File tree

2 files changed

+18
-63
lines changed

2 files changed

+18
-63
lines changed

go.mod

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/containerd/console v1.0.3
1111
github.com/containerd/containerd v1.6.1
1212
github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e
13-
github.com/docker/buildx v0.8.0
13+
github.com/docker/buildx v0.8.0 // when updating, also update the replace rules accordingly
1414
github.com/docker/cli v20.10.12+incompatible
1515
github.com/docker/cli-docs-tool v0.4.0
1616
github.com/docker/docker v20.10.7+incompatible
@@ -124,16 +124,24 @@ require (
124124
gopkg.in/inf.v0 v0.9.1 // indirect
125125
gopkg.in/yaml.v2 v2.4.0 // indirect
126126
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
127-
k8s.io/apimachinery v0.23.4 // indirect
128-
k8s.io/client-go v0.23.4 // indirect
127+
k8s.io/apimachinery v0.23.4 // indirect; see replace for the actual version used
128+
k8s.io/client-go v0.23.4 // indirect; see replace for the actual version used
129129
k8s.io/klog/v2 v2.30.0 // indirect
130130
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
131-
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
132131
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
133132
sigs.k8s.io/yaml v1.2.0 // indirect
134133
)
135134

136135
replace (
137136
github.com/docker/cli => github.com/docker/cli v20.10.3-0.20220309205733-2b52f62e9627+incompatible
138137
github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220309172631-83b51522df43+incompatible
138+
139+
// For k8s dependencies, we use a replace directive, to prevent them being
140+
// upgraded to the version specified in containerd, which is not relevant to the
141+
// version needed.
142+
// See https://github.com/docker/buildx/pull/948 for details.
143+
// https://github.com/docker/buildx/blob/v0.8.0/go.mod#L62-L64
144+
k8s.io/api => k8s.io/api v0.22.4
145+
k8s.io/apimachinery => k8s.io/apimachinery v0.22.4
146+
k8s.io/client-go => k8s.io/client-go v0.22.4
139147
)

0 commit comments

Comments
 (0)