-
Notifications
You must be signed in to change notification settings - Fork 1.6k
✨: Add go mod tidy to be executed after the scaffolding api #2037
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
✨: Add go mod tidy to be executed after the scaffolding api #2037
Conversation
|
Welcome @dastergon! |
|
Hi @dastergon. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
/ok-to-test |
be89258 to
c59eb20
Compare
camilamacedo86
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please squash the commits?
c59eb20 to
b027ecd
Compare
|
Hi @camilamacedo86, I rebased and squashed the commits. |
|
@camilamacedo86 it looks like that the issue is fixed, but there's a new |
|
Hi @dastergon, The #2040 will solve that. Thank you. |
Can you try with go 1.15 please? Go 1.16 is not officially supported. |
|
@Adirio I own an MB Air with Apple Silicon and I can only use Go >=1.16. |
|
Hi @dastergon,
I am not sure why you can only use the latest release of GO. I also use Mac and 1.15 on it. For we officially support 1.16 we need to upgrade the KB tool and the files which are scaffolded by it. You are free to use go 1.16. However, we cannot ensure that it will work well for all scenarios yet. Could you please rebase it with the master for we are able to get your PR merged. |
b027ecd to
0d42eb0
Compare
|
@camilamacedo86 rebase done ✅ I use 1.16 because it now supports M1 (Apple Silicon). |
Adirio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this error is related to go1.16 somehow, so I would consider this a feature (✨) unless we can replicate this with go1.15, in which case I would keep the bugfix (🐛) emoji.
0d42eb0 to
1e76e5c
Compare
Adirio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold
Holding until we can check if this is a bug-fix or a new feature
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Adirio, dastergon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
HI @dastergon, Could you change your commit message for something such as |
1e76e5c to
da33e0f
Compare
da33e0f to
2ef938f
Compare
|
@camilamacedo86 I rebased and updated the commit message. |
|
/lgtm |
This PR adds an extra step in the API creation subcommand to update
go.modafter scaffolding the API to make sure we have a freshgo.modin cases of new dependencies introduced by the generated controllers.My setup
What is the issue?
Initially, I used the
operator-sdkto create a new operator, but, after creating an API I stumbled upon the following issue:Then, after investigating the code, I found that the error was coming from kubebuilder code and consequently, I looked at generating the controller via
kubebuilderto double-check. After running the basic commands, I got the same error:Then, to double-check I executed the tests of a fresh clone of the kubebuilder repo and I received the same error:
How I solved the issue
Instead of introducing
go mod tidyin the Makefile template, I decided to add it in thePostScaffoldingfunc of API creation subcommand for both v2 and v3, since a similar action is done in init subcommand as well.After I made the code changes, the tests in kubebuilder passed successfully. Also, I executed
make generateto update the mock data for this PR.PTAL. I am open to alternative solutions, in case this one is adding extra complexity.