Fellow developers,
Let's take a moment to celebrate Godeps. It was there for us in the early days. It blazed multi-component GOPATHs with us. It watched with pride as its Godeps directory grew up into vendor. It watched with amusement as hotshots like glide and govendor jumped into the dependency management arena, staggered, and fell silent. It has been a faithful worker, but is now long in the tooth and is easily confused. You need only look into its eyes to see that our dependency tree causes it pain. So we're putting Godeps out to pasture. We found a nice home for it on a build farm, where it can run as long as it wants to ("this might take a while") and never think about a diamond dependency again.
… awkward moment of silence …
Anyway... work to switch Kubernetes and published staging repos to use go modules (KEP, kubernetes/kubernetes PR, publishing bot PR) will likely be landing in the next day. Once it merges, I'll send a follow-up email that the changes are live.
What does this mean for kubernetes/kubernetes developers?
Use go1.12+ (you have to anyway for k8s 1.15+)
To set the version of a dependency, run `hack/pin-dependency.sh`
E.g. hack/pin-dependency.sh github.com/docker/docker 501cb131a7b7
Run multiple times to set versions for multiple dependencies, if needed
After setting versions, run `hack/update-vendor.sh`
To rebuild the vendor dir, run `hack/update-vendor.sh` (this also updates the aggregated LICENSES file and updates go.mod files)
It is *much* faster than the godeps-restore/godeps-save update scripts:
~3-4 minutes on first run
~1-2 minutes on subsequent runs
It no longer messes with your $GOPATH contents at all
It works consistently across operating systems
Just like before, if you start (or stop) using a dependency in kubernetes/kubernetes or in one of the staging components, you may need to run this to update recorded dependencies
What does this mean for consumers of staging components (like k8s.io/client-go)?
Go module-based consumers (if you use a go.mod file in your project):
Once work in progress merges, you can run commands like these as needed to record a dependency on the currently published version of a component (and your module will pick up the transitive dependency versions automatically):
go get k8s.io/client-go@master
go get k8s.io/api@master
go get k8s.io/apiserver@master
Once Kubernetes 1.15 is released, you can do the same thing with tagged versions (tagged versions prior to 1.15 did not publish dependency info in a format recognized by `go get`):
GOPATH-based consumers
If you are using a version of go prior to 1.11, or do not wish to use go modules, you can download `k8s.io/client-go` to your `$GOPATH` instead:
go get -u k8s.io/client-go/...
go get -u k8s.io/apimachinery/...
cd $GOPATH/src/k8s.io/client-go
git checkout kubernetes-1.14.0
cd $GOPATH/src/k8s.io/apimachinery
git checkout kubernetes-1.14.0
This checks out the currently tagged version of `k8s.io/client-go`, which includes most of its dependencies in its `k8s.io/client-go/vendor` path, and does not include go module info.
Consumers using other dependency managers (like glide) which inspect Godeps.json files for dependency versions can continue to do so for the immediate future. Godeps.json files will continue to be published for staging component repos at least until go 1.13 is in use and go modules are enabled by default.
Instructions for other dependency managers that maintain their own version and lock files are generally unaffected by this change
We've tested the changes across multiple machines, environments, and done test publishing runs to make this as smooth a transition as possible, but if you encounter problems building, updating vendored dependencies, or using the published component repos after the changes go live, don't hesitate to open an issue (tag `/sig api-machinery` and `/cc @liggitt @sttts` when you do).
--
You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/CAMBP-pK5i5qBq1b54884%2BqUNy%2Br5foPNn2tkvM-Lc9a8JePAZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/CANw6fcGjijA6B2er9Mjc00e_%2BfAs8Ymupwo-gD-4AR%2BQtkpkCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.