-
Notifications
You must be signed in to change notification settings - Fork 1.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
Once you move main.go scaffolding can't find it to add webhook configs #1719
Comments
Hi @christopherhein, The tool will scaffold data in the main.go so if you change the layout by moving the main.go it will no longer work. See that the Example
$ cd kubebuilder/testdata/project-v3
$ mkdir cmd
$ mv main.go cmd/main.go
also, for both, it shows the expected behaviour. in this way, could you clarify why in your opinion it would be a bug? |
Hey @camilamacedo86, sorry about that I should have been more clear. The error messaging is fine, the interaction is different which is confusing. If you’ve moved the
It would be nice if it still created |
Hi @christopherhein, It happens because the tool goes until face the issue in both cases. The tool has no rollback in failures case. IHMO the correct approach would ensure in the tool that the required files are when should be in the validate func of the plugin which means that the error would be raised before to do any scaffold. |
I think that would be acceptable if you were able to turn off updating |
Hi @christopherhein, Regards |
Absolutely, I will get something started. |
/close |
@christopherhein: 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. |
Hi @christopherhein, I think we can use this one to address the validation check to ensure that the main.go is in the root dir which is a very tiny change. |
/assign |
I am facing also this issue. I could run the cmd by moving temporary my main.go file to the root of the project. After running the cmd you can move back the main.go file to the place it is used to be. |
I also want to move my main.go into cmd package, bug it will be failed when create an API @camilamacedo86 |
When trying to scaffold a new webhook if the
main.go
has moved it will fail to create anything even just the webhook file and ignoring updating of themain.go
.I'm able to do the
create
command for new APIs and it will still succeed when themain.go
is moved even though it errors. I'd expect that I can at least create the{resource}_webhook.go
file at least.What versions of software are you using? Specifically, the following are often useful:
/kind bug
The text was updated successfully, but these errors were encountered: