Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revision v0.0.0: Unknown for go get k8s.io/kubernetes

How do I solve this problem?

$ go mod init
$ go get k8s.io/[email protected]
go: k8s.io/[email protected] requires
        k8s.io/[email protected]: reading k8s.io/api/go.mod at revision v0.0.0: unknown revision v0.0.0

Environment is:
go 1.13
ubuntu 16.04

like image 784
nene Avatar asked Nov 06 '22 11:11

nene


1 Answers

Go to version go1.16.7 linux/amd64.

This issue occurs because the dependency for kubernetes requires k8s.io/api v0.0.0 which is not present- https://github.com/kubernetes/kubernetes/blob/ddc4ed03657d6c8c009a5d915265d00cadcb634c/go.mod#L155

So we have to find the specific versions for what we require This dependency list fixed issue for me.

require github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20210902044020-c6c97a176521

replace (
    k8s.io/api => k8s.io/api v0.19.6
    k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.6
    k8s.io/apimachinery => k8s.io/apimachinery v0.19.6
    k8s.io/apiserver => k8s.io/apiserver v0.19.6
    k8s.io/cli-runtime => k8s.io/cli-runtime v0.19.6
    k8s.io/client-go => k8s.io/client-go v0.19.6
    k8s.io/cloud-provider => k8s.io/cloud-provider v0.19.6
    k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.19.6
    k8s.io/code-generator => k8s.io/code-generator v0.19.6
    k8s.io/component-base => k8s.io/component-base v0.19.6
    k8s.io/cri-api => k8s.io/cri-api v0.19.6
    k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.19.6
    k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.19.6
    k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.19.6
    k8s.io/kube-proxy => k8s.io/kube-proxy v0.19.6
    k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.19.6
    k8s.io/kubectl => k8s.io/kubectl v0.19.6
    k8s.io/kubelet => k8s.io/kubelet v0.19.6
    k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.19.6
    k8s.io/metrics => k8s.io/metrics v0.19.6
    k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.6
)
like image 143
Jatin Avatar answered Nov 08 '22 23:11

Jatin