kubebuilder icon indicating copy to clipboard operation
kubebuilder copied to clipboard

Kubebuilder validation markers are documented multiple times

Open tamalsaha opened this issue 5 years ago • 11 comments
trafficstars

Kubebuilder book defines the same marker multiple times. https://book.kubebuilder.io/reference/markers/crd-validation.html

Is that by mistake? If yes, can you please fix this? It is very confusing to a new user of these markers.

/kind bug

tamalsaha avatar May 10 '20 06:05 tamalsaha

Hi @tamalsaha,

Could you please let us know what marker is duplicated? See that, for example, the marker kubebuilder:validation:MaxItems is not equals kubebuilder:validation:MaxLength and the idea here is to allow users to check all options.

camilamacedo86 avatar May 15 '20 00:05 camilamacedo86

Pretty much the entire block of markers is duplicated after //+optional from what I can see. Might be something with the marker generation script.

hasbro17 avatar May 15 '20 01:05 hasbro17

/kind documentation

hasbro17 avatar May 15 '20 01:05 hasbro17

I see what you mean 👍 . Note that first, all options are (on field) then it has (on type). However, I agree that it is something that requires attention.

camilamacedo86 avatar May 15 '20 19:05 camilamacedo86

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

fejta-bot avatar Aug 13 '20 20:08 fejta-bot

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

fejta-bot avatar Sep 12 '20 21:09 fejta-bot

/lifecycle frozen

hasbro17 avatar Sep 13 '20 23:09 hasbro17

/remove-lifecycle rotten

camilamacedo86 avatar Sep 14 '20 11:09 camilamacedo86

These duplicated markers are actually not duplicated, but correspond to markers used for types vs fields. We can amend the documentation to deduplicate the appearance of markers and specify that a marker can be used on types and fields.

gabbifish avatar Nov 17 '20 18:11 gabbifish

IMO, we should make clear that markers are grouped by targets (field, type, ...), and therefore if a marker is valid for different targets it will appear in both sections, instead of removing them (or deduplicating them). Maybe even explicitly splitting them into targets using second-level titles.

Adirio avatar Mar 24 '21 12:03 Adirio

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

k8s-triage-robot avatar Feb 08 '23 01:02 k8s-triage-robot