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

Add Openshift v4.11 Schemas #142

Merged
merged 2 commits into from
Mar 29, 2023
Merged

Conversation

tricktron
Copy link
Contributor

@tricktron tricktron commented Mar 19, 2023

I created them the following way:

git clone https://github.com/openshift/api
git checkout release-4.11
mkdir crds
paths=($(find . -path ./vendor -prune -o -type d -regextype posix-extended -regex '.*v[0-9].*'))
controller-gen crd ${paths[@]/#/paths=} output:dir=./crds
mkdir jsonschemas
crd2jsonschema -o jsonschemas -a crds/*.yaml

For this you need the following two tools installed:

@eyarz
Copy link
Member

eyarz commented Mar 20, 2023

@tricktron very interesting!
can you share what is the diff between your crd2jsonschema and the one that we use to extract schemas for this catalog - openapi2jsonschema (from the Kubeconform project)?

@tricktron
Copy link
Contributor Author

@tricktron very interesting!

can you share what is the diff between your crd2jsonschema and the one that we use to extract schemas for this catalog - openapi2jsonschema (from the Kubeconform project)?

  • It uses openapi-schema-to-json-schema library under the hood which converts openAPI v3 to jsonschema draft 4.
  • It uses strict mode which means it disallows any properties which are not present in the schema if not explicitly allowed.

In summary, it delegates the important conversion step to a specialised and tested lib and has a defined jsonschema version 4 output which simplifies validation.

@eyarz
Copy link
Member

eyarz commented Mar 28, 2023

maybe for the OpenShift schemas, we need to make the path more similar to the kubernetes-json-schema project (e.g: CRDs-catalog/v4.11-strict/[objects]).

@tricktron WDYT?

@tricktron
Copy link
Contributor Author

maybe for the OpenShift schemas, we need to make the path more similar to the kubernetes-json-schema project (e.g: CRDs-catalog/v4.11-strict/[objects]).

@tricktron WDYT?

I can easily change the path. You can tell me what works best for the crds-catalog project. In your proposal I am somehow missing that this is acutally about openshift. So maybe:

CRDs-catalog/openshift/v4.11-strict/[objects] or CRDs-catalog/openshift.io/v4.11-strict/[objects]?

@eyarz
Copy link
Member

eyarz commented Mar 28, 2023

CRDs-catalog/openshift/v4.11-strict/[objects]

@tricktron
Copy link
Contributor Author

@eyarz I renamed it to your proposed CRDs-catalog/openshift/v4.11-strict/[objects] path.

@eyarz eyarz merged commit 8f31fcb into datreeio:main Mar 29, 2023
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.

2 participants