Skip to content

Commit 2c5d660

Browse files
antoninbasheanlan
authored andcommitted
Fix Antrea Octant plugin build (antrea-io#4107)
The plugin had 2 conflicting indirect Go dependencies: - github.com/googleapis/gnostic - github.com/google/gnostic Having these 2 dependencies caused the same .proto file to be registered twice, and caused the antrea-octant-plugin binary to panic on start. github.com/googleapis/gnostic is the old module name, while github.com/google/gnostic is the new one. New K8s versions (e.g., v1.24 which is used by Antrea) depend on github.com/google/gnostic, while older versions (e.g., v1.21 which is used by Octant) depend on github.com/googleapis/gnostic. To resolve this issue (at least temporarily), we ensure that only K8s v1.21 libraries are used to build the plugin, and we eliminate the github.com/google/gnostic dependency. This is achieved by adding a few missing replace directives. Fixes antrea-io#4083 Signed-off-by: Antonin Bas <abas@vmware.com>
1 parent 92e040d commit 2c5d660

3 files changed

Lines changed: 9 additions & 123 deletions

File tree

go.mod

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,3 @@ require (
189189
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
190190
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
191191
)
192-
193-
// Newer version of github.com/googleapis/gnostic make use of newer gopkg.in/yaml(v3), which conflicts with
194-
// explicit imports of gopkg.in/yaml.v2.
195-
replace github.com/googleapis/gnostic v0.5.5 => github.com/googleapis/gnostic v0.4.1

plugins/octant/go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
)
1010

1111
require (
12+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
1213
github.com/BurntSushi/toml v0.3.1 // indirect
1314
github.com/Microsoft/go-winio v0.5.0 // indirect
1415
github.com/Microsoft/hcsshim v0.8.20 // indirect
@@ -42,7 +43,6 @@ require (
4243
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4344
github.com/golang/protobuf v1.5.2 // indirect
4445
github.com/golang/snappy v0.0.3 // indirect
45-
github.com/google/gnostic v0.5.7-v3refs // indirect
4646
github.com/google/go-cmp v0.5.5 // indirect
4747
github.com/google/go-intervals v0.0.2 // indirect
4848
github.com/google/gofuzz v1.2.0 // indirect
@@ -137,6 +137,10 @@ replace (
137137
// The current version of Octant does not build with version v0.24.0 of
138138
// the K8s libraries.
139139
k8s.io/api => k8s.io/api v0.21.3
140+
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.3
140141
k8s.io/apimachinery => k8s.io/apimachinery v0.21.3
141142
k8s.io/client-go => k8s.io/client-go v0.21.3
143+
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.21.3
144+
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7
145+
k8s.io/metrics => k8s.io/metrics v0.21.3
142146
)

0 commit comments

Comments
 (0)