Skip to content

Marker to disable validation #962

@displague

Description

@displague

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions