controller-tools icon indicating copy to clipboard operation
controller-tools copied to clipboard

Better docs for `UniqueItems`

Open guettli opened this issue 10 months ago • 6 comments

Afaik the kubebuilder docs are autogenerated from this repo.

I would like to improve the docs about UniqueItems

https://book.kubebuilder.io/reference/markers/crd-validation.html#crd-validation

I get:

Forbidden: uniqueItems cannot be set to true since the runtime complexity becomes quadratic


I would like to add the answer to this question to the docs:

What alternatives does a CRD author have (except writing a web hook)?

Example CRD:

type FooSpec struct {
    // +kubebuilder:validation:UniqueItems=true
    MyItems []string `json:"myItems"`

guettli avatar Jan 30 '25 08:01 guettli