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

cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/autoscaling.x-k8s.io/v1beta1: import lookup disabled by -mod=vendor #6664

Closed
azylinski opened this issue Mar 28, 2024 · 4 comments · Fixed by #6668
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@azylinski
Copy link
Contributor

Which component are you using?:

cluster-autoscaler

What version of the component are you using?:

latest / master

What environment is this in?:

docker

What did you expect to happen?:

make test-in-docker <-- should PASS

What happened instead?:

$ make test-in-docker 
rm -f cluster-autoscaler-amd64
docker build --network=default -t autoscaling-builder ../builder
Sending build context to Docker daemon  4.608kB
Step 1/10 : FROM golang:1.22.1
 ---> e49d53614208
Step 2/10 : LABEL maintainer="Marcin Wielgus <mwielgus@google.com>"
 ---> Using cache
 ---> c6955c4b8456
Step 3/10 : ENV GOPATH /gopath/
 ---> Using cache
 ---> d8a2a4e31934
Step 4/10 : ENV PATH $GOPATH/bin:$PATH
 ---> Using cache
 ---> 7f4bf158d234
Step 5/10 : ENV GO111MODULE auto
 ---> Using cache
 ---> 2bd4683f0565
Step 6/10 : RUN apt-get update && apt-get --yes install libseccomp-dev
 ---> Using cache
 ---> d6cf4519bb49
Step 7/10 : RUN go version
 ---> Using cache
 ---> 69e5b67990c2
Step 8/10 : RUN go install github.com/tools/godep@latest
 ---> Using cache
 ---> 8c1fd4d3dcdc
Step 9/10 : RUN godep version
 ---> Using cache
 ---> 67c22827409b
Step 10/10 : CMD ["/bin/bash"]
 ---> Using cache
 ---> 7695991a0993
Successfully built 7695991a0993
Successfully tagged autoscaling-builder:latest
docker run  -v `pwd`:/cluster-autoscaler/:Z autoscaling-builder:latest bash -c 'cd /cluster-autoscaler && go test -race ./... '
processors/provreq/provisioning_request_injector.go:25:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/autoscaling.x-k8s.io/v1beta1: import lookup disabled by -mod=vendor
        (Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:28:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/clientset/versioned: import lookup disabled by -mod=vendor
        (Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/testutils.go:28:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/clientset/versioned/fake: import lookup disabled by -mod=vendor
        (Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:29:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/informers/externalversions: import lookup disabled by -mod=vendor
        (Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:30:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1: import lookup disabled by -mod=vendor
        (Go version in go.mod is at least 1.14 and vendor directory exists.)
make: *** [Makefile:112: test-in-docker] Error 1

Anything else we need to know?:

This bug was most likely introduced in: #6315

I suspect some replace directive is missing in go.mod

/assign @tenzen-y
/cc @x13n

@azylinski azylinski added the kind/bug Categorizes issue or PR as related to a bug. label Mar 28, 2024
@tenzen-y
Copy link
Member

ACK

@tenzen-y
Copy link
Member

@azylinski I could not reproduce it on my local.
Actually, we have replaced directive here:

replace k8s.io/autoscaler/cluster-autoscaler/apis => ./apis

@x13n @kisieland Have you seen this error on your local?

@x13n
Copy link
Member

x13n commented Mar 28, 2024

Thanks @tenzen-y for checking. I just checked myself on HEAD and got the same error as @azylinski

$ git pull
$ git log --oneline -1
7184d23e6 (HEAD -> master, upstream/master) Merge pull request #6662 from azylinski/rm-NodeInfoProcessor
$ make test-in-docker
(...)
Step 10/10 : CMD ["/bin/bash"]
 ---> Running in 5f3874ad6039
Removing intermediate container 5f3874ad6039
 ---> 21859bdf5759
Successfully built 21859bdf5759
Successfully tagged autoscaling-builder:latest
docker run  -v `pwd`:/cluster-autoscaler/:Z autoscaling-builder:latest bash -c 'cd /cluster-autoscaler && go test -race ./... '
processors/provreq/provisioning_request_injector.go:25:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/autoscaling.x-k8s.io/v1beta1: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:28:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/clientset/versioned: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/testutils.go:28:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/clientset/versioned/fake: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:29:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/informers/externalversions: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:30:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
make: *** [Makefile:112: test-in-docker] Error 1

@tenzen-y
Copy link
Member

tenzen-y commented Mar 28, 2024

Thanks @tenzen-y for checking. I just checked myself on HEAD and got the same error as @azylinski

$ git pull
$ git log --oneline -1
7184d23e6 (HEAD -> master, upstream/master) Merge pull request #6662 from azylinski/rm-NodeInfoProcessor
$ make test-in-docker
(...)
Step 10/10 : CMD ["/bin/bash"]
 ---> Running in 5f3874ad6039
Removing intermediate container 5f3874ad6039
 ---> 21859bdf5759
Successfully built 21859bdf5759
Successfully tagged autoscaling-builder:latest
docker run  -v `pwd`:/cluster-autoscaler/:Z autoscaling-builder:latest bash -c 'cd /cluster-autoscaler && go test -race ./... '
processors/provreq/provisioning_request_injector.go:25:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/autoscaling.x-k8s.io/v1beta1: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:28:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/clientset/versioned: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/testutils.go:28:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/clientset/versioned/fake: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:29:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/informers/externalversions: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
provisioningrequest/provreqclient/client.go:30:2: cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
make: *** [Makefile:112: test-in-docker] Error 1

@x13n Thank you for checking it. After I cloned this repository again, I could reproduce it.
I'll create PR to fix it.

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants