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 https://github.com/kubernetes-sigs/kubebuilder/issues/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 https://github.com/kubernetes-sigs/kubebuilder/issues/301
/kind feature
or use an external openapiv3 reference
Unfortunately, references aren't supported by the kube extensions API server (which is responsible for serving CRs), and external references are unlikely to ever be supported (internal references may be eventually, though).
/priority backlong
/help
@DirectXMan12:
This request has been marked as needing help from a contributor.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
or use an external openapiv3 reference
Unfortunately, references aren't supported by the kube extensions API server (which is responsible for serving CRs), and external references are unlikely to ever be supported (internal references may be eventually, though).
/priority backlong
/help
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
(this seems reasonable, though)
I was able to work-around the initial problem (CRD file size) by removing the documentation (rather than the validation) for this resource.
This was done using cli arguments. https://github.com/crossplaneio/crossplane/pull/702/files#diff-b67911656ef5d18c4ae36cb6741b7965R99
Similar to this issue, "It should be possible to add a marker comment to a _field_ to _set the maxDescLen_".
If it was possible to set maxDescLen at an _object_ level then a change like the PR above wouldn't have needed to split up paths to apply different command line arguments per package.
longterm, we'd like to make it not an issue (you shouldn't have to choose whether or not your API docs show field documentation), which is why I'm hesitant to set maxDescLen at an object-level
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue with/reopen.
Mark the issue as fresh with/remove-lifecycle rotten.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.