Skip to content
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

Marker to disable validation #962

Closed
displague opened this issue Aug 22, 2019 · 10 comments
Closed

Marker to disable validation #962

displague opened this issue Aug 22, 2019 · 10 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@displague
Copy link
Member

displague commented Aug 22, 2019

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

@DirectXMan12
Copy link
Contributor

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

@k8s-ci-robot
Copy link
Contributor

@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.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Sep 3, 2019
@DirectXMan12
Copy link
Contributor

(this seems reasonable, though)

@displague
Copy link
Member Author

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.

@DirectXMan12
Copy link
Contributor

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

@DirectXMan12
Copy link
Contributor

See also kubernetes/kubernetes#82292

@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 2, 2019
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 1, 2020
@fejta-bot
Copy link

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

@k8s-ci-robot
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants