Add JSON schema generation for kubeconform CRD validation
ci/woodpecker/pr/kubeconform Pipeline failed
ci/woodpecker/pr/pre-commit Pipeline was successful

- 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
- Remove all kubeconform skip lists — all resource types now have schemas
This commit is contained in:
2026-06-28 16:53:11 +10:00
parent cfca1e5278
commit 041016fc80
264 changed files with 142907 additions and 2 deletions
@@ -0,0 +1,198 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"clusterName": {
"minLength": 1,
"type": "string"
},
"maxUnhealthy": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-kubernetes-int-or-string": true
},
"nodeStartupTimeout": {
"type": "string"
},
"remediationTemplate": {
"properties": {
"apiVersion": {
"type": "string"
},
"fieldPath": {
"type": "string"
},
"kind": {
"type": "string"
},
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"resourceVersion": {
"type": "string"
},
"uid": {
"type": "string"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
},
"selector": {
"properties": {
"matchExpressions": {
"items": {
"properties": {
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
}
},
"required": [
"key",
"operator"
],
"type": "object"
},
"type": "array",
"x-kubernetes-list-type": "atomic"
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
},
"unhealthyConditions": {
"items": {
"properties": {
"status": {
"minLength": 1,
"type": "string"
},
"timeout": {
"type": "string"
},
"type": {
"minLength": 1,
"type": "string"
}
},
"required": [
"status",
"timeout",
"type"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"unhealthyRange": {
"pattern": "^\\[[0-9]+-[0-9]+\\]$",
"type": "string"
}
},
"required": [
"clusterName",
"selector",
"unhealthyConditions"
],
"type": "object"
},
"status": {
"properties": {
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"format": "date-time",
"type": "string"
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
},
"severity": {
"type": "string"
},
"status": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"status",
"type"
],
"type": "object"
},
"type": "array"
},
"currentHealthy": {
"format": "int32",
"minimum": 0,
"type": "integer"
},
"expectedMachines": {
"format": "int32",
"minimum": 0,
"type": "integer"
},
"observedGeneration": {
"format": "int64",
"type": "integer"
},
"remediationsAllowed": {
"format": "int32",
"minimum": 0,
"type": "integer"
},
"targets": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
}