-
Notifications
You must be signed in to change notification settings - Fork 4k
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
VPA: go modules reference local files #2507
Comments
#2486 Does not unfortunately fully add support for go modules. TL;DR: we use go mod only to construct the vendor directory, based on kubernetes/kubernetes dependencies. Long version: What we do is we copy the go.mod file from kubernetes/kubernetes repo and then fix all the dependencies to what is in the staging directory. Then we use go mod to construct the vendor directory. So the go.mod file is not fully valid. See https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/update_deps.sh I'd like to both document the process better and work on making this setup less ugly, but it will take some time. If you have ideas, let me know. |
wondering if we can reuse any ideas from kubernetes/kubernetes#79384 or in the worst case create a staging dir here as well to move the absolute paths I quite like and prefer the script mentioned in kubernetes/kubernetes#79384 (comment) which based on depending kubernetes/kubernetes version figures out the sha1 of those staged repos. That should transform all I have used it in #2485 (f98049c), so you can inspect the output and go.mod a little bit before trying it. The tests were passing but not sure if it indeed covered all scenarios necessary. Also in my PR I completely moved from |
The script looks really handy. Would you be willing to have a go at another PR that incorporates the script into the deps management, so that we can pin our dependencies to some k8s version? Moving to go mod should be fine, as long as we keep the vendor directory. |
sure thing, happy to help (probably will find time either late Friday or this weekend) :) |
Perfect, thank you! Let me know if you need any help. |
To keep you informed @bskiba, over the weekend there has been some discussion about go modules and common practices when using kubernetes as modules - kubernetes/kube-state-metrics#949 (comment) Feel free to chime in, we are trying to identify requirements and potential paths about how to move forward. |
#2486 has added support for go modules but the modules file references locally checked out repositories that may not be present on other machines
autoscaler/vertical-pod-autoscaler/go.mod
Lines 297 to 325 in 086999e
The recommended hack scripts to update dependencies also seem to be missing from the repository
autoscaler/vertical-pod-autoscaler/go.mod
Lines 1 to 3 in 086999e
cc: @bskiba
The text was updated successfully, but these errors were encountered: