Skip to content

✨ (crd): Add +kubebuilder:skip:description markers to omit package and spec descriptions#1384

Open
camilamacedo86 wants to merge 1 commit into
kubernetes-sigs:mainfrom
camilamacedo86:add-feature-skip-desc
Open

✨ (crd): Add +kubebuilder:skip:description markers to omit package and spec descriptions#1384
camilamacedo86 wants to merge 1 commit into
kubernetes-sigs:mainfrom
camilamacedo86:add-feature-skip-desc

Conversation

@camilamacedo86
Copy link
Copy Markdown
Member

@camilamacedo86 camilamacedo86 commented Apr 20, 2026

This adds two new markers to reduce CRD size when types have extensive documentation:

  • Spec-level: Skip description for specific specs
  type MyCRD struct {                                                           
      // This description will appear in the CRD                                
      ImportantField string `json:"importantField"`                             
                                                   
      // This long description won't appear in the CRD                          
      // +kubebuilder:skip:description                                     
      LargeField ComplexType `json:"largeField"`                                
  }
  • Package-level: Skip all descriptions in a package
  // +kubebuilder:skip:description                                              
  package v1alpha1                                          

Useful when CRDs exceed size limits due to extensive godoc comments on deeply nested types.

Closes: #441

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: camilamacedo86
Once this PR has been reviewed and has the lgtm label, please assign vincepri for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@camilamacedo86 camilamacedo86 changed the title chore(crd): Add +kubebuilder:skipfield:description and +kubebuilder:skip:description markers to omit field descriptions ✨ (crd): Add +kubebuilder:skipfield:description and +kubebuilder:skip:description markers to omit field descriptions Apr 20, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 20, 2026
@camilamacedo86 camilamacedo86 changed the title ✨ (crd): Add +kubebuilder:skipfield:description and +kubebuilder:skip:description markers to omit field descriptions WIP ✨ (crd): Add +kubebuilder:skipfield:description and +kubebuilder:skip:description markers to omit field descriptions Apr 20, 2026
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 20, 2026
@camilamacedo86 camilamacedo86 force-pushed the add-feature-skip-desc branch from 1b189cb to 3330b6f Compare April 20, 2026 15:26
@camilamacedo86 camilamacedo86 changed the title WIP ✨ (crd): Add +kubebuilder:skipfield:description and +kubebuilder:skip:description markers to omit field descriptions WIP ✨ (crd): Add +kubebuilder:skip:description markers to omit package and spec descriptions Apr 20, 2026
@camilamacedo86 camilamacedo86 force-pushed the add-feature-skip-desc branch from 3330b6f to e2d6fdb Compare April 20, 2026 15:32
@camilamacedo86 camilamacedo86 changed the title WIP ✨ (crd): Add +kubebuilder:skip:description markers to omit package and spec descriptions ✨ (crd): Add +kubebuilder:skip:description markers to omit package and spec descriptions Apr 20, 2026
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 20, 2026
@Vaishnav88sk
Copy link
Copy Markdown

Should this also work at the field level, or is it intentionally package/spec-scoped only? Worth documenting that scope explicitly in the marker definition so users don't go hunting.

@camilamacedo86
Copy link
Copy Markdown
Member Author

Hi @Vaishnav88sk

Should this also work at the field level, or is it intentionally package/spec-scoped only? Worth documenting that scope explicitly in the marker definition so users don't go hunting.

Thank you for looking on this one.
But yes, it is the field level as well.
You can check the description examples

Please, feel free to let me know if the PR description does not clarifies this one.

@Vaishnav88sk
Copy link
Copy Markdown

Hi @Vaishnav88sk

Should this also work at the field level, or is it intentionally package/spec-scoped only? Worth documenting that scope explicitly in the marker definition so users don't go hunting.

Thank you for looking on this one. But yes, it is the field level as well. You can check the description examples

Please, feel free to let me know if the PR description does not clarifies this one.

Got it, thanks for clarifying! Checked the examples in the description - the field-level scope is clear from there. Makes sense as-is then. 👍

@Vaishnav88sk
Copy link
Copy Markdown

LGTM 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to skip descriptions per field or per package

3 participants