Add JSON schema generation for kubeconform CRD validation
- ci/generate-schemas.sh extracts schemas from live cluster CRDs via kubectl - Generated schemas committed to schemas/ for CI use - Run `make schemas` to regenerate after CRD or K8s version changes - validate-apps.sh and validate-clusters.sh check local schemas first - CRD instances (Gateway, TLSRoute, Pooler, etc.) now validated instead of skipped - CustomResourceDefinition meta-type still skipped (no schema exists upstream)
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object"
|
||||
},
|
||||
"spec": {
|
||||
"properties": {
|
||||
"images": {
|
||||
"items": {
|
||||
"properties": {
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"major": {
|
||||
"minimum": 10,
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"image",
|
||||
"major"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"maxItems": 8,
|
||||
"minItems": 1,
|
||||
"type": "array",
|
||||
"x-kubernetes-validations": [
|
||||
{
|
||||
"message": "Images must have unique major versions",
|
||||
"rule": "self.all(e, self.filter(f, f.major==e.major).size() == 1)"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"images"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"metadata",
|
||||
"spec"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
Reference in New Issue
Block a user