instrumenta / instrumenta/kubeval
cannot validate CustomResourceDefinitions
- Dominant language
- Go
- Stars
- 3.2k
- Forks
- 227
- PR merge metrics
- No merged PRs in 30d
Description
Apologies if this should be created against https://github.com/garethr/kubernetes-json-schema instead.
Attempting to validate a `apiextensions.k8s.io/v1beta1 CustomResourceDefinition` resource fails as the schema file in `$VERSION-standalone` is empty:
```
1 error occurred:
* Problem loading schema from the network at https://raw.githubusercontent.com/garethr/kubernetes-json-schema/master/v1.8.5-standalone/customresourcedefinition.json: EOF
```
```
[mattbrown@mattmbp kubernetes-json-schema]$ wc -c v1.*-standalone/customresourcedefinition.json
0 v1.8.0-standalone/customresourcedefinition.json
0 v1.8.1-standalone/customresourcedefinition.json
0 v1.8.2-standalone/customresourcedefinition.json
0 v1.8.3-standalone/customresourcedefinition.json
0 v1.8.4-standalone/customresourcedefinition.json
0 v1.8.5-standalone/customresourcedefinition.json
0 v1.8.6-standalone/customresourcedefinition.json
0 v1.9.0-standalone/customresourcedefinition.json
0 total
```
Is this intentional? It seems impossible in the current form to lint any `CustomResourceDefinition`s. The `kubernetes-json-schema` repo does have non-0 byte versions of the schema in the non-standalone directories (i.e. in `/v1.8.0/`) but `kubeval` is hardcoded to load the `-standalone` flavor of each schema.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing kubeval's schema-loading path and how it constructs the Kubernetes schema URL, then compare the empty -standalone CustomResourceDefinition files with the non-standalone versions described in the issue. Done means kubeval can load and validate apiextensions.k8s.io/v1beta1 CustomResourceDefinition resources for the affected Kubernetes versions without the EOF error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100