yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.15k stars 121 forks source link

could not find schema for SecretProviderClass" #227

Closed KylanZhang closed 11 months ago

KylanZhang commented 1 year ago
savf commented 1 year ago

This is expected behaviour since the schema repository cannot cover all possible schemas. You can however add your own OpenAPI schemas with the parameter: -schema-location "crdSchemas/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json" where crdSchemas would contain the individual JSON schemas, for example secretproviderclass_v1.json for the SecretProviderClass schema.

You can get the schema JSON directly from deployed CRDs from your cluster, e.g.:

kubectl get crd/secretproviderclasses.secrets-store.csi.x-k8s.io -o json | jq '.spec.versions[]?.schema.openAPIV3Schema'
yannh commented 11 months ago

As @savf suggested, or you could also use this repository which collects the most common CRDs: https://github.com/datreeio/CRDs-catalog !