Test-infra: Kubetest command gives invalid working directory error.

Created on 11 Mar 2020  路  5Comments  路  Source: kubernetes/test-infra

Kubetest installation gives following errors

What happened:
This is my error report

2020/03/11 16:21:26 Warning: Couldn't find directory src/k8s.io/kubernetes under any of GOPATH /home/ekamdeep/work/k8s.io, defaulting to /home/ekamdeep/work/k8s.io/src/k8s.io/kubernetes
2020/03/11 16:21:26 Warning: Couldn't find directory src/sigs.k8s.io/cloud-provider-azure under any of GOPATH /home/ekamdeep/work/k8s.io, defaulting to /home/ekamdeep/work/k8s.io/src/k8s.io/cloud-provider-azure
2020/03/11 16:21:26 Warning: Couldn't find directory src/k8s.io/kubernetes under any of GOPATH /home/ekamdeep/work/k8s.io, defaulting to /home/ekamdeep/work/k8s.io/src/k8s.io/kubernetes
2020/03/11 16:21:26 main.go:318: Something went wrong: called from invalid working directory: must run from kubernetes directory root. current: /home/ekamdeep

What you expected to happen:
kubetest command to run properly

Steps I followed to install kubetest:

  • [ ] Cloned test-infra repo in home directory as $home//work/k8s.io/test-infra

  • [ ] Run command GO111MODULE=on go install ./kubetest from inside test-infra

  • [ ] It did some processing like

go/test/fixedbugs/issue15002.go
go/test/fixedbugs/issue15013.go
go/test/fixedbugs/issue15039.go
go/test/fixedbugs/issue15042.go
go/test/fixedbugs/issue15055.go
go/test/fixedbugs/issue15071.dir/
go/test/fixedbugs/issue15071.dir/exp.go
go/test/fixedbugs/issue15071.dir/main.go
go/test/fixedbugs/issue15071.go
go/test/fixedbugs/issue15084.go
go/test/fixedbugs/issue15091.go
go/test/fixedbugs/issue15141.go
go/test/fixedbugs/issue15175.go
go/test/fixedbugs/issue15252.go
go/test/fixedbugs/issue15277.go
go/test/fixedbugs/issue15281.go
go/test/fixedbugs/issue15303.go

Then tried testing by running kubetest and above error occurs.

I am using go version 1.13.3. What am I doing wrong?

kinbug

Most helpful comment

create your cloud-provider-azure directory under /home/chetanbendre/go/src/sigs.k8s.io (NOT under /home/chetanbendre/go/src/k8s.io)

All 5 comments

/assign

@ekamdz : It seems that you haven't set your GOPATH variable correctly. Could you please set it properly and then retry?

@divya-mohan0209
Even I am facing the same issue.
Getting

2020/04/20 17:16:22 Warning: Couldn't find directory src/sigs.k8s.io/cloud-provider-azure under any of GOPATH /home/chetanbendre/go, defaulting to /home/chetanbendre/go/src/k8s.io/cloud-provider-azure
2020/04/20 17:16:22 main.go:314: Something went wrong: called from invalid working directory: must run from kubernetes directory root. current: /home/chetanbendre/go/src/k8s.io/test-infra/kubetest

GOPATH is correctly set
/home/chetanbendre/go

create your cloud-provider-azure directory under /home/chetanbendre/go/src/sigs.k8s.io (NOT under /home/chetanbendre/go/src/k8s.io)

you'll need to follow the upstream development requirements. https://github.com/kubernetes/test-infra/issues/16734#issuecomment-616506766

Was this page helpful?
0 / 5 - 0 ratings