forked from emissary-ingress/emissary
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
godeps: Fuss with go.mod so that automated editing of it works right
- Put all of the indirect rependencies together - Use 'exclude' instead of 'replace' for v0.0.0 versions - Remove some obsolete comments - put the 'exclude' and 'replace' blocks before the 'require' blocks. Signed-off-by: Luke Shumaker <[email protected]>
- Loading branch information
Showing
3 changed files
with
48 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,24 +32,54 @@ go 1.17 | |
// version, run `go mod vendor`, then grep for "=>" in | ||
// `./vendor/modules.txt`. If you don't see a "=>" line for that | ||
// replacement in modules.txt, then that's an indicator that we | ||
// don't really need that `replace`, maybe replacing it with a | ||
// `require` (or not; see the notes on go-autorest below). | ||
// don't really need that `replace`, maybe instead using a | ||
// `require`. | ||
// | ||
// 3. If you do add a `replace` command to this file, you must also | ||
// add it to the go.mod in apro.git (see above for explanation). | ||
// | ||
// 4. Use `make go-mod-tidy` instead of `go mod tidy`. Normal `go | ||
// mod tidy` will try to remove `github.com/cncf/udpa`--don't let | ||
// it, that would break `make generate`; the github.com/cncf/udpa | ||
// version needs to be kept in-sync with the | ||
// github.com/cncf/udpa/go version (`make go-mod-tidy` will do | ||
// this). | ||
|
||
// Because we (unfortunately) need to require k8s.io/kubernetes, which | ||
// is (unfortunately) managed in a way that makes it hostile to being | ||
// used as a library (see | ||
// https://news.ycombinator.com/item?id=27827389) we need to tell Go | ||
// to not try to resolve those bogus/broken v0.0.0 versions. | ||
exclude ( | ||
k8s.io/api v0.0.0 | ||
k8s.io/apiextensions-apiserver v0.0.0 | ||
k8s.io/apimachinery v0.0.0 | ||
k8s.io/apiserver v0.0.0 | ||
k8s.io/cli-runtime v0.0.0 | ||
k8s.io/client-go v0.0.0 | ||
k8s.io/cloud-provider v0.0.0 | ||
k8s.io/cluster-bootstrap v0.0.0 | ||
k8s.io/code-generator v0.0.0 | ||
k8s.io/component-base v0.0.0 | ||
k8s.io/component-helpers v0.0.0 | ||
k8s.io/controller-manager v0.0.0 | ||
k8s.io/cri-api v0.0.0 | ||
k8s.io/csi-translation-lib v0.0.0 | ||
k8s.io/kube-aggregator v0.0.0 | ||
k8s.io/kube-controller-manager v0.0.0 | ||
k8s.io/kube-proxy v0.0.0 | ||
k8s.io/kube-scheduler v0.0.0 | ||
k8s.io/kubectl v0.0.0 | ||
k8s.io/kubelet v0.0.0 | ||
k8s.io/legacy-cloud-providers v0.0.0 | ||
k8s.io/metrics v0.0.0 | ||
k8s.io/mount-utils v0.0.0 | ||
k8s.io/sample-apiserver v0.0.0 | ||
) | ||
|
||
// We've got some bug-fixes that we need for conversion-gen and | ||
// controller-gen. | ||
replace ( | ||
k8s.io/code-generator v0.20.4 => github.com/emissary-ingress/code-generator v0.20.5-rc.0.0.20220120231034-6c7797b9220f | ||
sigs.k8s.io/controller-tools v0.5.0 => github.com/emissary-ingress/controller-tools v0.5.1-0.20220120234851-b97c2515f1c2 | ||
) | ||
|
||
require ( | ||
github.com/Masterminds/semver v1.5.0 // indirect | ||
github.com/Masterminds/sprig v2.22.0+incompatible | ||
github.com/argoproj/argo-rollouts v1.0.7 | ||
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect | ||
github.com/census-instrumentation/opencensus-proto v0.2.1 | ||
github.com/cncf/udpa/go v0.0.0-20210322005330-6414d713912e | ||
github.com/datawire/dlib v1.2.5-0.20211116212847-0316f8d7af2b | ||
|
@@ -63,19 +93,14 @@ require ( | |
github.com/google/uuid v1.1.2 | ||
github.com/gorilla/websocket v1.4.2 | ||
github.com/hashicorp/consul/api v1.3.0 | ||
github.com/huandu/xstrings v1.3.2 // indirect | ||
github.com/imdario/mergo v0.3.11 // indirect | ||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 | ||
github.com/miekg/dns v1.1.35 // indirect | ||
github.com/mitchellh/mapstructure v1.3.3 // indirect | ||
github.com/pkg/errors v0.9.1 | ||
github.com/pmezard/go-difflib v1.0.0 | ||
github.com/prometheus/client_model v0.2.0 | ||
github.com/sirupsen/logrus v1.7.0 | ||
github.com/spf13/cobra v1.1.1 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/stretchr/testify v1.7.0 | ||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect | ||
golang.org/x/mod v0.5.1 | ||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c | ||
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a | ||
|
@@ -110,9 +135,11 @@ require ( | |
github.com/Azure/go-autorest/tracing v0.6.0 // indirect | ||
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd // indirect | ||
github.com/Masterminds/goutils v1.1.0 // indirect | ||
github.com/Masterminds/semver v1.5.0 // indirect | ||
github.com/PuerkitoBio/purell v1.1.1 // indirect | ||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect | ||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect | ||
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/docker/distribution v2.7.1+incompatible // indirect | ||
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect | ||
|
@@ -139,22 +166,27 @@ require ( | |
github.com/hashicorp/go-rootcerts v1.0.0 // indirect | ||
github.com/hashicorp/golang-lru v0.5.4 // indirect | ||
github.com/hashicorp/serf v0.8.2 // indirect | ||
github.com/huandu/xstrings v1.3.2 // indirect | ||
github.com/imdario/mergo v0.3.11 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/json-iterator/go v1.1.10 // indirect | ||
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect | ||
github.com/mailru/easyjson v0.7.0 // indirect | ||
github.com/mattn/go-colorable v0.1.8 // indirect | ||
github.com/mattn/go-isatty v0.0.12 // indirect | ||
github.com/miekg/dns v1.1.35 // indirect | ||
github.com/mitchellh/copystructure v1.0.0 // indirect | ||
github.com/mitchellh/go-homedir v1.1.0 // indirect | ||
github.com/mitchellh/go-wordwrap v1.0.0 // indirect | ||
github.com/mitchellh/mapstructure v1.3.3 // indirect | ||
github.com/mitchellh/reflectwalk v1.0.1 // indirect | ||
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.1 // indirect | ||
github.com/opencontainers/go-digest v1.0.0 // indirect | ||
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect | ||
github.com/russross/blackfriday v1.5.2 // indirect | ||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect | ||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect | ||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect | ||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect | ||
|
@@ -172,70 +204,3 @@ require ( | |
sigs.k8s.io/kustomize v2.0.3+incompatible // indirect | ||
sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect | ||
) | ||
|
||
// We've got some bug-fixes that we need for conversion-gen and | ||
// controller-gen. | ||
replace ( | ||
k8s.io/code-generator v0.20.4 => github.com/emissary-ingress/code-generator v0.20.5-rc.0.0.20220120231034-6c7797b9220f | ||
sigs.k8s.io/controller-tools v0.5.0 => github.com/emissary-ingress/controller-tools v0.5.1-0.20220120234851-b97c2515f1c2 | ||
) | ||
|
||
// Because we (unfortunately) need to require k8s.io/kubernetes, which | ||
// is (unfortunately) managed in a way that makes it hostile to being | ||
// used as a library (see | ||
// https://news.ycombinator.com/item?id=27827389) we need to provide | ||
// replacements for a bunch of k8s.io modules that it refers to by | ||
// bogus/broken v0.0.0 versions. | ||
replace ( | ||
k8s.io/api v0.0.0 => k8s.io/api v0.20.4 | ||
k8s.io/apiextensions-apiserver v0.0.0 => k8s.io/apiextensions-apiserver v0.20.4 | ||
k8s.io/apimachinery v0.0.0 => k8s.io/apimachinery v0.20.4 | ||
k8s.io/apiserver v0.0.0 => k8s.io/apiserver v0.20.4 | ||
k8s.io/cli-runtime v0.0.0 => k8s.io/cli-runtime v0.20.4 | ||
k8s.io/client-go v0.0.0 => k8s.io/client-go v0.20.4 | ||
k8s.io/cloud-provider v0.0.0 => k8s.io/cloud-provider v0.20.4 | ||
k8s.io/cluster-bootstrap v0.0.0 => k8s.io/cluster-bootstrap v0.20.4 | ||
k8s.io/code-generator v0.0.0 => k8s.io/code-generator v0.20.4 | ||
k8s.io/component-base v0.0.0 => k8s.io/component-base v0.20.4 | ||
k8s.io/component-helpers v0.0.0 => k8s.io/component-helpers v0.20.4 | ||
k8s.io/controller-manager v0.0.0 => k8s.io/controller-manager v0.20.4 | ||
k8s.io/cri-api v0.0.0 => k8s.io/cri-api v0.20.4 | ||
k8s.io/csi-translation-lib v0.0.0 => k8s.io/csi-translation-lib v0.20.4 | ||
k8s.io/kube-aggregator v0.0.0 => k8s.io/kube-aggregator v0.20.4 | ||
k8s.io/kube-controller-manager v0.0.0 => k8s.io/kube-controller-manager v0.20.4 | ||
k8s.io/kube-proxy v0.0.0 => k8s.io/kube-proxy v0.20.4 | ||
k8s.io/kube-scheduler v0.0.0 => k8s.io/kube-scheduler v0.20.4 | ||
k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.20.4 | ||
k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.20.4 | ||
k8s.io/legacy-cloud-providers v0.0.0 => k8s.io/legacy-cloud-providers v0.20.4 | ||
k8s.io/metrics v0.0.0 => k8s.io/metrics v0.20.4 | ||
k8s.io/mount-utils v0.0.0 => k8s.io/mount-utils v0.20.4 | ||
k8s.io/sample-apiserver v0.0.0 => k8s.io/sample-apiserver v0.20.4 | ||
) | ||
|
||
// The issue doesn't trigger with the current versions of our | ||
// dependencies, but if you ever get an error message like: | ||
// | ||
// /path/to/whatever.go.go:7:2: ambiguous import: found package github.com/Azure/go-autorest/autorest in multiple modules: | ||
// github.com/Azure/go-autorest v10.8.1+incompatible (/home/lukeshu/go/pkg/mod/github.com/!azure/[email protected]+incompatible/autorest) | ||
// github.com/Azure/go-autorest/autorest v0.9.0 (/home/lukeshu/go/pkg/mod/github.com/!azure/go-autorest/[email protected]) | ||
// | ||
// then uncomment the `replace` line below, adjusting the version | ||
// number to the left of the "=>" to match the error message. | ||
// | ||
// The go-autorest one is a little funny; we don't actually use that | ||
// module; we use the nested "github.com/Azure/go-autorest/autorest" | ||
// module, which split off from it some time between v11 and v13; and | ||
// we just need to tell it to consider v13 instead of v11 so that it | ||
// knows to use the nested module (instead of complaining about | ||
// "ambiguous import: found package in multiple modules"). We could | ||
// do this with | ||
// | ||
// require github.com/Azure/go-autorest v13.3.2+incompatible | ||
// | ||
// but `go mod tidy` would remove it and break the build. We could | ||
// inhibit `go mod tidy` from removing it by importing a package from | ||
// it in `./pkg/ignore/pin.go`, but there are actually no packages in | ||
// it to import; it's entirely nested modules. | ||
// | ||
//replace github.com/Azure/go-autorest v10.8.1+incompatible => github.com/Azure/go-autorest v13.3.2+incompatible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.