Prompt to install CRD manually when Kind no found#57
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: interma If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| log.Fatal(err) | ||
| switch err.(type) { | ||
| case *meta.NoKindMatchError: | ||
| log.Fatalf("No kind %v found, please install CRD in advance.", err.(*meta.NoKindMatchError).GroupKind) |
There was a problem hiding this comment.
I am wondering if we should add more context in the error in the controller-runtime library itself instead of putting the logic in generated code, WDYT ?
There was a problem hiding this comment.
My thoughts:
Generally, lib (controller-tools) emits all errors and client (kubebuilder) decides what behavior to perform. Based on this point, my PR make sense.
But considering our client code is generated, more concise the better. I think to handle this error in controller-tools is also a good idea. Do you have some ideas about which code should I modify?
Thanks!
There was a problem hiding this comment.
Sorry, didn't follow this thread.
Actually, our client code is no longer generated. Kubebuilder project uses client pkg from https://github.com/kubernetes-sigs/controller-runtime. May be, we can just wrap the error when returning from client's pkg. Can you pl. investigate.
There was a problem hiding this comment.
Sure, I will check later.
I will ping you if have some problems. Thanks.
|
@droot I opened a new PR in controller-runtime: Please help to review, thanks. |
|
closing this PR for now. |
Fix: kubernetes-sigs/kubebuilder#337
New output:
Thanks for the review.