-
Notifications
You must be signed in to change notification settings - Fork 431
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
inline field description added for CRD generation #1133
Comments
Where in the schema would this go? As far as I'm aware, when you have an inlined structure, the inlined field does not appear in the schema at all, so there wouldn't be an appropriate place to put the commonspec description. Did you have somewhere in mind? |
As far as I remember there is basically one description field in the schema for this and we pick one of these godoc comments to set it (and not both) |
Thanks @JoelSpeed @sbueringer In my opinion, is it possible to add this inline field description to the upper base description field and if the inline field has description then use it otherwise use inline structure description? |
Can you provide a concrete example? I'm not sure what you actually mean by "upper base description" and an example of where in the generated schema this would end up would probably be helpful |
Thanks @JoelSpeed Demo case: controller-tools/pkg/crd/testdata/cronjob_types.go Lines 381 to 391 in f827bcb
Can add this description to:
Add to L42 or L45? |
You've linked the wrong part of the CRD schema, the actual part here is controller-tools/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml Lines 237 to 240 in f827bcb
You can see the If you added them to the parent of If you were to merge with the description of |
Whether to add new fields to populate it? |
I'm not quite certain what you mean by add a new field, I can interpret that in two ways. Either you mean add a new field into this specific schema, which would then change the shape of the serialized resources, you'd go from
to
Which is the same effect as changing the json tag to not be inline. Changing this behaviour would be majorly breaking. Or you mean to add an extra Moving aside from the mechanics here, why do you actually want the documentation from the inlined field to appear on your CRD schema? I'm not sure I get what the use case is here? You can add documentation to individual fields already, so what's missing that prevents you from achieving some goal for your project? |
The embedded types (
CommonSpec
) need to be annotated withjson:",inline"
with some description. so the fields description added in the generated CRDe.g.
The text was updated successfully, but these errors were encountered: