-
Notifications
You must be signed in to change notification settings - Fork 425
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 selectablefield marker #1050
Conversation
Welcome @everesio! |
Hi @everesio. 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-sigs/prow repository. |
@@ -55,6 +55,9 @@ var CRDMarkers = []*definitionWithHelp{ | |||
|
|||
must(markers.MakeDefinition("kubebuilder:metadata", markers.DescribesType, Metadata{})). | |||
WithHelp(Metadata{}.Help()), | |||
|
|||
must(markers.MakeDefinition("kubebuilder:selectablefield", markers.DescribesType, SelectableField{})). |
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.
Let's add a few of these to
// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes-sigs/controller-tools";"cert-manager.io/inject-ca-from-secret=cert-manager/cert-manager-webhook-ca" |
IIRC they then also have to be added here: https://github.com/kubernetes-sigs/controller-tools/blob/7ef21aae5452047af82f020774639c94aa659eca/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml
(but you can just check the failing test after the marker was added to the type)
/ok-to-test |
@everesio Do you have time to address the findings above? |
@sbueringer Sorry, I thought the remarks were directed at the other reviewers.
|
I am just wondering if there is a regression, as the generated specification creates more differences than expected. This issue also occurs on the main branch without my changes. The binary was built with See result everesio@fa0ae90 Generated output with warnings:
|
No worries!
I was mostly wondering when this case would happen. But it seems like it's just a safeguard against a case that should never happen in practice. I think let's leave it as is and also not try to add test coverage for it
Not sure I have a good answer to that. What I did in the past was to modify cronjob_types.go and then run the tests in parser_integration_test.go. The resulting output than made it clear how the YAML with the CRD has to be modified. I would propose to do the same here to unblock this PR and then maybe open a separate issue to investigate why these testdata YAMLs differ from the ones that controller-gen would produce. |
Test added. I've modified cronjob_types.go and testdata.kubebuilder.io_cronjobs.yaml |
Thank you!! /lgtm |
LGTM label has been added. Git tree hash: 22f9975283d774300b2e665b744c8c83bd605d23
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: everesio, sbueringer 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 |
Add support for selectable fields for custom resources #1039