Skip to content
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

CRDGenerator: Allow to configure categories #5795

Open
baloo42 opened this issue Mar 11, 2024 · 5 comments · May be fixed by #6457
Open

CRDGenerator: Allow to configure categories #5795

baloo42 opened this issue Mar 11, 2024 · 5 comments · May be fixed by #6457
Labels
component/crd-generator Related to the CRD generator

Comments

@baloo42
Copy link
Contributor

baloo42 commented Mar 11, 2024

Is your enhancement related to a problem? Please describe

At the moment there is no easy way to configure the categories of a generator CRD:
https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#categories

Describe the solution you'd like

A new @Categories annotation allows to configure a list of categories (similar to @ShortNames):

/**
 * Specifies categories of a Custom Resource.
 */
@Target({ TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Categories {

  /**
   * @return the categories this Custom Resource belongs to.
   */
  String[] value();

}

The CRD-Generator detects this annotation on Custom Resource classes and creates a CRD which contains those categories.

Describe alternatives you've considered

As long as we stay to the "seperate annotations" strategy, adding categories to an existing annotation looks to me as a bad idea. If there are plans to consolidate them, I would revise this opinion.

Additional context

No response

Copy link

stale bot commented Jun 13, 2024

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale label Jun 13, 2024
@stale stale bot closed this as completed Jun 23, 2024
@manusa manusa reopened this Aug 9, 2024
@stale stale bot removed the status/stale label Aug 9, 2024
@MichaelMorrisEst
Copy link

Is anyone working on this or is there any plans for it to be implemented?

@baloo42
Copy link
Contributor Author

baloo42 commented Oct 14, 2024

This has for me a lower priority compared to other missing features I'm currently working on. But I already had such a requirement and I'm sure I will have it again. So I plan to implement it someday in the future.

Feel free to contribute a solution. I have updated the description and added more details on how it could be implemented.

@manusa Can you check the description and confirm it is going in the right direction?

@MichaelMorrisEst
Copy link

Thanks @baloo42 for the info. I will contribute a PR.
Just one question - is crd-generator-api considered deprecated and therefore I should only implement for crd-generator-api-v2 or should I implement for both?

@baloo42
Copy link
Contributor Author

baloo42 commented Oct 15, 2024

Would be nice, thanks!

You only have to implement it in crd-generator/api-v2 ("api v2").
New features for crd-generator/api ("api v1") won't get merged by the maintainers. So it is kind of deprecated, but as far as I know, there is no official timeline for the deprecation yet.

@MichaelMorrisEst MichaelMorrisEst linked a pull request Oct 16, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/crd-generator Related to the CRD generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants