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

CA build fails with: cannot find module providing package .../apis/provisioningrequest/... #6693

Closed
pmendelski opened this issue Apr 5, 2024 · 2 comments · Fixed by #6695
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@pmendelski
Copy link
Contributor

pmendelski commented Apr 5, 2024

Which component are you using?:
cluster-autoscaler

What version of the component are you using?:
latest / master

What environment is this in?:
docker and localhost

What did you expect to happen?:
I expect master to build :)

What happened instead?:
Build on a fresh clone fails with cannot find module providing package k8s.io/autoscaler/cluster-autoscaler/apis/provisioningrequest/...

How to reproduce it (as minimally and precisely as possible):

# Please use fresh clone
❯ git clone git@github.com:kubernetes/autoscaler.git
❯ cd autoscaler/cluster-autoscaler
❯ make build-arch-amd64
rm -f cluster-autoscaler-amd64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o cluster-autoscaler-amd64 --ldflags "-s"
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:45: build-arch-amd64] Error 1

Executing make build-in-docker-arch-amd64 produces similar result.

Anything else we need to know?:

@pmendelski pmendelski added the kind/bug Categorizes issue or PR as related to a bug. label Apr 5, 2024
@pmendelski pmendelski changed the title CA build fails with: cannot find module providing package .../apis/provisioningrequest/autoscaling.x-k8s.io/v1beta1 CA build fails with: cannot find module providing package .../apis/provisioningrequest/... Apr 5, 2024
@towca
Copy link
Collaborator

towca commented Apr 5, 2024

Ok, this is one of the fun bugs 😅

First line of our .gitignore is cluster-autoscaler. The dependencies we're missing from vendor should be in vendor/k8s.io/autoscaler/cluster-autoscaler - so they're ignored by git. They don't show up in git status, which is why it seems that go mod vendor doesn't do anything. But the files are actually vendored after go mod vendor, which is why build starts passing locally after that, and persists.

@pmendelski
Copy link
Contributor Author

Thanks a lot for a quick intervention. In-deed, a funny one 😅
I created a fix.

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.

2 participants