kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

[crd-gen] Possibility to add extra information to fields

Open andreaTP opened this issue 3 years ago • 4 comments

Is your enhancement related to a problem? Please describe

The most self-explanatory example is the type format hint allowed in the CRD such as:

weight:
  description: weight associated with matching
    the corresponding podAffinityTerm, in the
    range 1-100.
  format: int32
  type: integer

Currently the generator emits only the type information and we don't have, at best of my knowledge, any way to express a specific format.

I'm opening this ticket more widely in the hope that we can agree on a solution that will cover additional use-cases:

  • x-kubernetes-list-type
  • pattern
  • format
  • default
  • nullable
  • ...

but I'm open to evaluate specific solutions (e.g. one per missing property).

Describe the solution you'd like

A possible solution, again, is a new custom annotation, even if some of those fields might be extracted more automagically by the generator (e.g. nullable and default).

Describe alternatives you've considered

No response

Additional context

cc. @metacosm

andreaTP avatar Jan 19 '22 12:01 andreaTP

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[bot] avatar Apr 27 '22 06:04 stale[bot]

+1

maruiz93 avatar Apr 26 '23 16:04 maruiz93

Is this still applicable? Is there still interest on this?

manusa avatar Mar 07 '24 11:03 manusa

Someone was asking for something similar on SO recently: https://stackoverflow.com/questions/78028591/fabric8-crd-generator-is-it-possible-to-generate-crd-yaml-with-x-kubernetes-va

I think it's still compelling, but let see ...

andreaTP avatar Mar 07 '24 11:03 andreaTP

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[bot] avatar Jun 13 '24 02:06 stale[bot]