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

Error when using go get with go modules #80316

Closed
dioguerra opened this issue Jul 18, 2019 · 7 comments
Closed

Error when using go get with go modules #80316

dioguerra opened this issue Jul 18, 2019 · 7 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@dioguerra
Copy link

What happened:
go get k8s.io/kubernetes/pkg/apis/core/v1 errors with

[...]
go: k8s.io/kube-aggregator@v0.0.0: unknown revision v0.0.0
go: error loading module requirements

What you expected to happen:
Correct installation of all indirect dependencies? Error does not specify problem

How to reproduce it (as minimally and precisely as possible):
go mod init dns-tools
go get k8s.io/kubernetes/pkg/apis/core/v1 errors with

Environment:

  • Kubernetes version (use kubectl version):kubectl version
    Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-25T15:45:25Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}

  • Cloud provider or hardware configuration: OpenStack

  • OS (e.g: cat /etc/os-release): cat /etc/os-release
    PRETTY_NAME="Debian GNU/Linux 10 (buster)"
    NAME="Debian GNU/Linux"
    VERSION_ID="10"
    VERSION="10 (buster)"
    VERSION_CODENAME=buster
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"

  • Kernel (e.g. uname -a):uname -a
    Linux Somewho 4.19.0-5-amd64 Unit test coverage in Kubelet is lousy. (~30%) #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64 GNU/Linux

@dioguerra dioguerra added the kind/bug Categorizes issue or PR as related to a bug. label Jul 18, 2019
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jul 18, 2019
@dioguerra
Copy link
Author

/sig api-machinery
@kubernetes/sig-api-machinery-bugs

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 18, 2019
@k8s-ci-robot
Copy link
Contributor

@mrd2: Reiterating the mentions to trigger a notification:
@kubernetes/sig-api-machinery-bugs

In response to this:

/sig api-machinery
@kubernetes/sig-api-machinery-bugs

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@roycaihw
Copy link
Member

cc @dims @liggitt

@liggitt
Copy link
Member

liggitt commented Jul 18, 2019

k8s.io/kubernetes is not intended to be used with go get

the published staging repos can be used that way (e.g. go get k8s.io/api@<version>)

If you want to depend on k8s.io/kubernetes with go modules, you would need to define require directives for matching levels of all of the published staging repositories in your go.mod file

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closing this issue.

In response to this:

k8s.io/kubernetes is not intended to be used with go get

the published k8s.io/api repos can be used that way

If you want to depend on k8s.io/kubernetes with go modules, you would need to define require directives for matching levels of all of the published staging repositories in your go.mod file

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@idevz
Copy link

idevz commented Jul 31, 2019

hi, @liggitt what did you mean by

If you want to depend on k8s.io/kubernetes with go modules, you would need to define require directives for matching levels of all of the published staging repositories in your go.mod file

is it like I import "client-go" using import "k8s.io/kubernetes/staging/src/k8s.io/client-go/kubernetes" instead of import "k8s.io/client-go/kubernetes"?

@idevz
Copy link

idevz commented Jul 31, 2019

hi, @liggitt
thanks a lot, I did this below, and it work for me:

	k8s.io/api => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/api
	k8s.io/apiextensions-apiserver => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/apiextensions-apiserver
	k8s.io/apimachinery => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/apimachinery
	k8s.io/apiserver => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/apiserver
	k8s.io/cli-runtime => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/cli-runtime
	k8s.io/client-go => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/client-go
	k8s.io/cloud-provider => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/cloud-provider
	k8s.io/cluster-bootstrap => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/cluster-bootstrap
	k8s.io/code-generator => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/code-generator
	k8s.io/component-base => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/component-base
	k8s.io/cri-api => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/cri-api
	k8s.io/csi-translation-lib => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/csi-translation-lib
	k8s.io/kube-aggregator => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/kube-aggregator
	k8s.io/kube-controller-manager => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/kube-controller-manager
	k8s.io/kube-proxy => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/kube-proxy
	k8s.io/kube-scheduler => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/kube-scheduler
	k8s.io/kubectl => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/kubectl
	k8s.io/kubelet => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/kubelet
	k8s.io/kubernetes => /Users/idevz/code/k8s-x/kubernetes
	k8s.io/legacy-cloud-providers => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/legacy-cloud-providers
	k8s.io/metrics => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/metrics
	k8s.io/sample-apiserver => /Users/idevz/code/k8s-x/kubernetes/staging/src/k8s.io/sample-apiserver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

5 participants