-
Notifications
You must be signed in to change notification settings - Fork 1.8k
How to migrate to modules for operator project that uses dep? #1810
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
Comments
@jsanda Hey John, thanks for the question. I looked and didn't see anything either. I'll see what can be done. |
Hi @jmrodri. Nice to hear from you and thanks for helping out :) The project is currently using v0.7.0 of operator-sdk. I was working on upgrading to v0.9.0. This resulted in some changes to the project's CircleCI configuration which we might be able to circumvent by migrating to modules. I have run into various dependency/build issues when I trying moving to module at v0.7.0 as well as at v0.9.0. I suspect that some of those bumps might be unavoidable so any guidance is greatly appreciated. |
Let me share what I m hitting in case it is of any help:
|
kubernetes/kubernetes#79149 may be relevant. |
HI @jsanda, It https://blog.callr.tech/migrating-from-dep-to-go-1.11-modules/ may help you with. |
@jsanda I'd typically recommend using the EDIT: you should be able to use Instead you may be able to piece things together using our operator-sdk/internal/pkg/scaffold/go_mod.go Lines 40 to 92 in 560208d
|
Thanks for the reference @camilamacedo86. It was helpful. Since I am upgrading a project on v0.7.0 I decided to create the example project at https://github.com/operator-framework/operator-sdk/tree/v0.7.0 and upgrade from it to see what happens. I was able to reproduce the error, but I think it was because I needed to run I then went back through the example app a second time and successfully upgraded. Here is a summary of my steps:
The first time I went through those steps but left out I still have some errors in my project to resolve, but I think it is just a matter of sorting out some dependencies. @joelanford thanks for the tip! Should help with resolving my errors. |
@jsanda #1819 allows you to force dep manager type using $ operator-sdk print-deps --dep-manager modules > go.mod
$ rm Gopkg.toml Gopkg.lock
$ export GO111MODULES=on
$ operator-sdk build my-image Note this only works with |
Type of question
building with
operator-sdk
Question
I have a project that was that currently uses dep and all dependencies are declared in Go.toml. I am trying to migrate to Go modules but not clear on how exactly to do this. Are there documented steps for this?
#1566 mentions that new projects should use modules, but the PR does not mention what to do for existing projects that already use a vendor directory.
The text was updated successfully, but these errors were encountered: