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

Use deprecated field of yaml schema specification instead of only modifying description #2817

Closed
apupier opened this issue Dec 7, 2021 · 6 comments

Comments

@apupier
Copy link
Contributor

apupier commented Dec 7, 2021

There is a deprecated field in specification http://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.3
it would be nice to use it instead of mentioning the deprecation only in description field like here

description: 'Deprecated: use template'

it will allow various tooling to make it more visible.

@squakez
Copy link
Contributor

squakez commented Dec 7, 2021

Yeah, it would be good to have. We are generating the CRDs with some tooling and I haven't found an immediate way to declare the value is deprecated, ie Resources []ResourceSpec json:"resources,omitempty,deprecated". Not sure if it exists some struct label that is taken in consideration when we generate the CRDs.

@squakez
Copy link
Contributor

squakez commented Dec 7, 2021

Maybe we're lucky if we bump the gen-tool version: kubernetes-sigs/controller-tools#541

Going to have a look later.

@astefanutti
Copy link
Member

While CRD structural schemas rely on OpenAPI v3 schemas, there are some limitations. The deprecated field cannot be set, as documented in:

https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation

The +kubebuilder:deprecatedversion marker applies at the CRD level, not the field level.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2022

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

@apupier
Copy link
Contributor Author

apupier commented Mar 8, 2022

still an important feature even if upstream doesn't provide an out of the box solution currently

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

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

No branches or pull requests

3 participants