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

Support for strict / non-strict validation #102

Open
yannh opened this issue Jan 24, 2023 · 1 comment
Open

Support for strict / non-strict validation #102

yannh opened this issue Jan 24, 2023 · 1 comment

Comments

@yannh
Copy link

yannh commented Jan 24, 2023

An interesting discussion started over here: yannh/kubeconform#171
A user is pointing out (correctly I believe) that we don't really make the distinction for strict vs non-strict validation for CRDs, whereas kubernetes-json-schema has schemas for both "strict" and "non-strict" mode. The strict schemas will complain when keys are used in the resource that are not present in the schema, vs the non-strict mode will not count this as an error.

In the user's case, they use a self-generated json schema, but I was wondering what the viewpoint was here - whether CRDs-catalog should also provide a strict and non-strict JSON schema for each CRD, or what the default really should be (I would be tempted to say, default to strict?).

Best,
Yann

@eyarz
Copy link
Member

eyarz commented Jan 26, 2023

To be frank, we didn't consider this when we started this project.
we are using the schema that is generated by default via the openapi2jsonschema.py script, and it looks like those are not strict.

I don't see any reason why not to address this issue, so if the community would like to submit PRs we will accept them :)

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

No branches or pull requests

2 participants