-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Building with go modules suddenly returns 'cannot find module providing package' #551
Comments
k8s.io/api v0.0.0-20190126160303 indicates it is pulling from the master branch of k8s.io/api (and other k8s dependencies) That alpha API was just recently removed in master in preparation for 1.14 you need to either pull from the master branch of client-go as well, or pin the dependencies to a release branch rather than master /close |
@liggitt: Closing this issue. In response to this:
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. |
Thank you very much for the answer, it is exactly like you said :) Quick addition for all fellow go beginners who might come across this thread, here's how I got it to work using dependency pinning: Add the following to your go.mod file
(You can find a list of all available tags for the api package here https://github.com/kubernetes/api/tags) |
Remove use of alpha initializers Kubernetes-commit: e28c757e8758638811130848abe7a47f760057c0
My build is also failing with this message, and the above fix is not working. Any further idea on how to fix this? |
…lugin Kubernetes-commit: dc1fa870bff65c20f48a83ea3af54adb3f526e28
I manage to fix this issue by removing indirect dependency, change the version to:
and do |
API has been removed from master, so pulling these dependencies from master leads to build failures. This commit pins the dependencies to fix this. More at - kubernetes/client-go#551
Is this still working for everyone? It is not working for me at all.
|
The master branch has no admissionregistration/v1alpha1 anymore (1.13 did have it). That suggests that you vendor the master branch. |
Odd, so for some reason it's ignoring edit: I was mistaken. I was using update: Swapping |
I have the same problem. I think this can be reproduced by just starting fresh right now. Something is probably pulling in the v1alpha1 dependency. I don't directly depend on it at least. |
specify matching versions of all three k8s.io/... components in your go.mod file, for example:
if you want to be extra super sure that you are not using newer versions (even if some of your other dependencies want to), you can pin those versions in your top-level go.mod file:
opened https://github.com/kubernetes/kubernetes/pull/75595/files to update client-go INSTALL.md instructions with go module details |
It is working for me now on go 1.12.1 with the requirements @liggitt posted. |
None of this is working if I try to use the |
that requires client-go v11.0.0 (or you can use the if that doesn't work for you, can you provide your complete go.mod file? |
D'oh! Thank you, @liggitt! |
I'm running into an issue where even after pinning these versions, specifying the replaces, and running the |
go will update require statements to reflect the maximal version desired among all your dependencies. however, the replace directives will govern what is actually used in the build. running |
@liggitt I am running into the same issue. Even the versions in the |
For posterity, I ran into the same issue. I was pinning all my Is there something up with the |
This is still happening . Trying to follow this example
|
copy from kubebuilder
|
For my case, I just need to keep
|
this will accomplish the same thing:
|
@liggitt I tried that, but failed, I think that one is some transitive dep? |
For anyone trying to use go mod init
go mod vendor
go mod download Running Go 1.15 // go.mod
Took me a while to find this - adding the language above to help others looking for a solution here. Also important to note that I had to reset my cache from building was a previous version of the libraries as well. |
git config core.ignorecase false --local to set git don't igrnore alpha case and then run go mod to re-gen the vendor |
Hi there,
I've been using client-go in combination with go modules and got it to work last week. However suddenly it fails with the following message:
Go modules seems to be correctly set-up in the project as I am able to resolve other dependencies (e.g. logrus) without any issues.
Steps to reproduce
Additional Info
go.mod
go.sum
The text was updated successfully, but these errors were encountered: