You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have several different classes that were auto generated from these protobufs that appear to contain circular references. When I set one of these classes as the Spec property for an entity I will get a stack overflow when doing a build. I am currently working around this by setting IgnoreEntity attribute on the kubernetes entity and manually creating/updating the CRD.
Because of how complex the spec type is, I have just been setting the type as object and adding x-kubernetes-preserve-unknown-fields: true to the property in the CRD schema.
Describe the solution you'd like
Ideally I would like an attribute I can set on my Spec properties that will create an empty properties and set type: object and x-kubernetes-preserve-unknown-fields: true. A solution could be to add an IgnoreEntityPropertyAttribute and if that is set in combination with PreserveUnknownFieldsAttribute then the generated CRD for that property would look like:
If I recall it correctly, the logic to generate the CRDs is recursive. Maybe there is some error hidden in there :-) I'll have a look, thank you for the report!
Since posting the bug I have also found a better workaround for the issue. I just set the spec type to object and the code generation works as desired giving me an empty object in the CRD yaml.
Is your feature request related to a problem? Please describe.
I have several different classes that were auto generated from these protobufs that appear to contain circular references. When I set one of these classes as the
Spec
property for an entity I will get a stack overflow when doing a build. I am currently working around this by settingIgnoreEntity
attribute on the kubernetes entity and manually creating/updating the CRD.Because of how complex the spec type is, I have just been setting the
type
as object and addingx-kubernetes-preserve-unknown-fields: true
to the property in the CRD schema.Describe the solution you'd like
Ideally I would like an attribute I can set on my
Spec
properties that will create an emptyproperties
and settype: object
andx-kubernetes-preserve-unknown-fields: true
. A solution could be to add anIgnoreEntityPropertyAttribute
and if that is set in combination withPreserveUnknownFieldsAttribute
then the generated CRD for that property would look like:Additional context
For reference, below is a shortened version of the stack trace for the stack overflow exception:
The text was updated successfully, but these errors were encountered: