Skip to content

Conversation

@camilamacedo86
Copy link

Description

The +required marker is now recognized and produces the same "Required: {}" output as +kubebuilder:validation:Required.

Motivation

// +required is a valid marker and should be recognised such as +kubebuilder:validation:Required
Also, see the issue: kubernetes-sigs/controller-tools#1241
The project will deprecate the +kubebuilder:validation:Required in favor of // +required

  The +required marker is now recognized and produces the same
  "Required: {}" output as +kubebuilder:validation:Required.

Assisted-by: CLAUDE
@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
048b183

Please, read and sign the above mentioned agreement if you want to contribute to this project

@camilamacedo86
Copy link
Author

Hi @tenstad @thbkrkr @charith-elastic @barkbay @zirain

I am not sure if I can sign your CLA.
I either would like to ask your help for we have only this small fix.

For optional // +optional you probably need to ensure the same.
Could you please help me out have it merged?
Can you please move forward with?

Please, feel free to get the code and and open a PR by yourselves.

@JoelSpeed
Copy link

We probably also want to consider implementing support for the Declarative validation style markers (+k8s:required) as the long term sig apimachinery plan would be to unify both CRD and native types on the same set of markers

@thbkrkr
Copy link
Contributor

thbkrkr commented Jan 6, 2026

Thanks!

Closing this in favor of #193 that builds on this work and adds support for the required/optional Kubernetes markers.

@thbkrkr thbkrkr closed this Jan 6, 2026
thbkrkr added a commit that referenced this pull request Jan 7, 2026
…#193)

This adds support for the +required, +k8s:required, +optional and +k8s:optional markers, aligning with upstream Kubernetes marker conventions.
Additionally, it improves the escaping of pipe character for validation value in Asciidoctor output to prevent formatting issues.

Based on the work from #192, with additional changes.
simonrw pushed a commit to simonrw/crd-ref-docs that referenced this pull request Jan 8, 2026
…elastic#193)

This adds support for the +required, +k8s:required, +optional and +k8s:optional markers, aligning with upstream Kubernetes marker conventions.
Additionally, it improves the escaping of pipe character for validation value in Asciidoctor output to prevent formatting issues.

Based on the work from elastic#192, with additional changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants