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

Pin etcd client version #148

Merged
Merged
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
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ go 1.13

// Pin k8s.io/* dependencies to kubernetes-1.16.0 to match controller-runtime v0.4.0
replace (
// This must match the version below
go.etcd.io/etcd => go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this doesn't have to match the version below. replace directives are always used regardless of the require directives below IF you are building the current module.

If something imports this module, then the replace directives are ignored, at which point those people depending on us may need a similar replace directive in their own module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you say it's 'good practice' to match as below?

k8s.io/api => k8s.io/api v0.0.0-20190918155943-95b840bb6a1f
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
Expand All @@ -13,16 +15,16 @@ replace (

require (
cloud.google.com/go v0.38.0
github.com/coreos/etcd v3.3.17+incompatible
github.com/dustinkirkland/golang-petname v0.0.0-20190613200456-11339a705ed2
github.com/go-logr/logr v0.1.0
github.com/google/go-cmp v0.3.0
github.com/google/gofuzz v1.0.0
github.com/robfig/cron/v3 v3.0.0
github.com/stretchr/testify v1.4.0
go.etcd.io/etcd v3.3.17+incompatible
// Pin spesific etcd version via tag. See https://github.com/etcd-io/etcd/pull/11477
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc these get re-written by go mod tidy anyway - if you just had the commit ref here it should work (and go mod will automatically compute to v0.0.0-* version of the ref)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These get re-written by go mod tidy

It doesn't seem to. I've run tidy a few times since I added this with no change.

I'm pretty much following the documentation for the version workaround.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I mean is if you added/manually specified the commit ref here, go mod tidy would rewrite it into the form you've written here 😄

I don't think using that linked script is necessary.. simply getting the ref for that tag and adding it here, then running go mod tidy should do it.

go.opencensus.io v0.22.1 // indirect
go.uber.org/zap v1.9.1
go.uber.org/zap v1.10.0
google.golang.org/api v0.13.0 // indirect
k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
Expand Down
Loading