Summary: invalid version: unknown revision v0.0.0 or v0.0.0.zip: 404 Not Found errors can occur when a Go module or one of its dependencies is attempting to use at least one package within the k8s.io/kubernetes module as a library/dependency, which is unsupported and not recommended by the Kubernetes project.
Please see the 2023-01-10 update below.
What happened:
Observed unknown revision v0.0.0 errors when getting kubernetes modules from a module-based consumer.
In particular, getting the master versions of k8s.io/kubernetes and k8s.io/api fails with the tip version of Go.
This is a follow-up to golang/go#27173 (comment), golang/go#27173 (comment), and golang/go#32776
How to reproduce it (as minimally and precisely as possible):
go get golang.org/dl/gotip && gotip download
export GOPROXY=direct
export GOSUMDB=off
export GOPATH=$(mktemp -d)
cd $(mktemp -d)
gotip mod init m
gotip get -v -d k8s.io/kubernetes@master # current master: 8c3b7d7679cc
gotip get -v -d k8s.io/api@master # current master: dcce3486da33
which fails with:
go: extracting k8s.io/api v0.0.0-20190620073856-dcce3486da33
go: downloading k8s.io/api v0.0.0
go get k8s.io/api@master: unknown revision v0.0.0
Anything else we need to know?:
According to golang/go#32776, it is apparently also possible to hit the unknown revision v0.0.0 error for kubernetes using Go 1.12, though the steps are different.
The v0.0.0 might be set in update-vendor.sh, but not sure:
|
go mod edit -require "${dep}@v0.0.0" |
@bcmills wrote in golang/go#27173 (comment):
I don't know why go1.12.6 doesn't detect the error in k8s.io/kubernetes, but gotip is correct to fail that sequence.
k8s.io/kubernetes requires k8s.io/api v0.0.0 here. There is no such version of k8s.io/api tagged, and because the repo doesn't have any semver-style tags, v0.0.0- is the correct pseudo-version prefix for its commits.
As far as I can tell, because k8s.io/kubernetes relies so heavily on replace directives to pin its dependencies it can only be built in module mode if it is the main module, or if the main module replicates its replace directives more-or-less exactly.
Environment:
- Kubernetes version (use
kubectl version):
k8s.io/kubernetes@master is 8c3b7d7
k8s.io/api@master is dcce3486da33
CC @liggitt, @sttts, @nikhita, @joshmsamuels
Summary:
invalid version: unknown revision v0.0.0orv0.0.0.zip: 404 Not Founderrors can occur when a Go module or one of its dependencies is attempting to use at least one package within thek8s.io/kubernetesmodule as a library/dependency, which is unsupported and not recommended by the Kubernetes project.Please see the 2023-01-10 update below.
What happened:
Observed
unknown revision v0.0.0errors when getting kubernetes modules from a module-based consumer.In particular, getting the master versions of k8s.io/kubernetes and k8s.io/api fails with the tip version of Go.
This is a follow-up to golang/go#27173 (comment), golang/go#27173 (comment), and golang/go#32776
How to reproduce it (as minimally and precisely as possible):
which fails with:
Anything else we need to know?:
According to golang/go#32776, it is apparently also possible to hit the
unknown revision v0.0.0error for kubernetes using Go 1.12, though the steps are different.The
v0.0.0might be set in update-vendor.sh, but not sure:kubernetes/hack/update-vendor.sh
Line 246 in 68aaf8b
@bcmills wrote in golang/go#27173 (comment):
Environment:
kubectl version):k8s.io/kubernetes@master is 8c3b7d7
k8s.io/api@master is dcce3486da33
CC @liggitt, @sttts, @nikhita, @joshmsamuels