- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.6k
Description
It should be possible to add a marker comment to a field to disable validation, resulting in an empty spec in the resultant CRD.
I have a type that includes either a apps.DeploymentSpec property or a batch.JobSpec property.  In older kubebuilder emitted CRD files, the spec for this field was simple, only type: object.  In kubebuilder2 the CRD explodes in file size as the complete deployment and job specs are included in the spec.
This is primarily a concern due to the CRD yaml size increasing to 700k in my case.  kubectl apply tries to keep that yaml in an annotation which exceeds the max size of an annotation (relating to #906).
Ignoring the kubectl apply limitations, it should be possible to omit the details in the spec block in the resultant CRD yaml (or use an external openapiv3 reference).  I assume that a feature to disable validation on this field would result in the spec block being omitted or simplified in the CRD yaml.
Here is the older kubebuilder output for this type:
https://github.com/crossplaneio/crossplane/blob/b6034989dae292c36ecdf20bde714f58fe8ec6cb/cluster/charts/crossplane/crds/extensions/v1alpha1/extension.yaml#L47-L52
And here is the new kubebuilder2 output (same type, but renamed from extensions to stacks):
https://github.com/crossplaneio/crossplane/blob/485ea8312614b2ee7736e189f01a2fa78b327b39/cluster/charts/crossplane/crds/stacks.crossplane.io_stacks.yaml#L55-L61
This may relate to #301
/kind feature