Add JSON schema generation for kubeconform CRD validation
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform 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
- 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:
2026-06-28 16:53:11 +10:00
parent cfca1e5278
commit 2bd8fcc0c2
264 changed files with 142907 additions and 2 deletions
+222
View File
@@ -0,0 +1,222 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"chart": {
"nullable": true,
"properties": {
"metadata": {
"nullable": true,
"properties": {
"annotations": {
"additionalProperties": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "object"
},
"apiVersion": {
"nullable": true,
"type": "string"
},
"appVersion": {
"nullable": true,
"type": "string"
},
"condition": {
"nullable": true,
"type": "string"
},
"deprecated": {
"type": "boolean"
},
"home": {
"nullable": true,
"type": "string"
},
"icon": {
"nullable": true,
"type": "string"
},
"keywords": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"kubeVersion": {
"nullable": true,
"type": "string"
},
"maintainers": {
"items": {
"properties": {
"email": {
"nullable": true,
"type": "string"
},
"name": {
"nullable": true,
"type": "string"
},
"url": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"name": {
"nullable": true,
"type": "string"
},
"sources": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"tags": {
"nullable": true,
"type": "string"
},
"type": {
"nullable": true,
"type": "string"
},
"version": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"values": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
}
},
"type": "object"
},
"helmVersion": {
"type": "integer"
},
"info": {
"nullable": true,
"properties": {
"deleted": {
"nullable": true,
"type": "string"
},
"firstDeployed": {
"nullable": true,
"type": "string"
},
"lastDeployed": {
"nullable": true,
"type": "string"
},
"notes": {
"nullable": true,
"type": "string"
},
"readme": {
"nullable": true,
"type": "string"
},
"status": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"name": {
"nullable": true,
"type": "string"
},
"namespace": {
"nullable": true,
"type": "string"
},
"resources": {
"items": {
"properties": {
"apiVersion": {
"nullable": true,
"type": "string"
},
"kind": {
"nullable": true,
"type": "string"
},
"name": {
"nullable": true,
"type": "string"
},
"namespace": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"values": {
"nullable": true,
"type": "object",
"x-kubernetes-preserve-unknown-fields": true
},
"version": {
"type": "integer"
}
},
"type": "object"
},
"status": {
"properties": {
"observedGeneration": {
"type": "integer"
},
"summary": {
"properties": {
"error": {
"type": "boolean"
},
"state": {
"nullable": true,
"type": "string"
},
"transitioning": {
"type": "boolean"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}
@@ -0,0 +1,163 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"basicAuthSecretName": {
"type": "string"
},
"caBundle": {
"format": "byte",
"type": "string"
},
"clientSecret": {
"properties": {
"name": {
"type": "string"
},
"namespace": {
"type": "string"
}
},
"type": "object"
},
"disableSameOriginCheck": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"exponentialBackOffValues": {
"properties": {
"maxRetries": {
"type": "integer"
},
"maxWait": {
"type": "integer"
},
"minWait": {
"type": "integer"
}
},
"type": "object"
},
"forceUpdate": {
"format": "date-time",
"type": "string"
},
"gitBranch": {
"type": "string"
},
"gitRepo": {
"type": "string"
},
"insecurePlainHttp": {
"type": "boolean"
},
"insecureSkipTLSVerify": {
"type": "boolean"
},
"refreshInterval": {
"type": "integer"
},
"serviceAccount": {
"type": "string"
},
"serviceAccountNamespace": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"status": {
"properties": {
"branch": {
"type": "string"
},
"commit": {
"type": "string"
},
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"type": "string"
},
"lastUpdateTime": {
"type": "string"
},
"message": {
"type": "string"
},
"reason": {
"type": "string"
},
"status": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"status",
"type"
],
"type": "object"
},
"type": "array"
},
"downloadTime": {
"format": "date-time",
"type": "string"
},
"indexConfigMapName": {
"type": "string"
},
"indexConfigMapNamespace": {
"type": "string"
},
"indexConfigMapResourceVersion": {
"type": "string"
},
"nextRetryAt": {
"format": "date-time",
"type": "string"
},
"numberOfRetries": {
"type": "integer"
},
"observedGeneration": {
"format": "int64",
"type": "integer"
},
"shouldNotSkip": {
"type": "boolean"
},
"url": {
"type": "string"
}
},
"required": [
"observedGeneration"
],
"type": "object"
}
},
"required": [
"spec"
],
"type": "object"
}
+135
View File
@@ -0,0 +1,135 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"status": {
"properties": {
"action": {
"nullable": true,
"type": "string"
},
"automaticCPTolerations": {
"type": "boolean"
},
"chart": {
"nullable": true,
"type": "string"
},
"command": {
"items": {
"nullable": true,
"type": "string"
},
"nullable": true,
"type": "array"
},
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"nullable": true,
"type": "string"
},
"lastUpdateTime": {
"nullable": true,
"type": "string"
},
"message": {
"nullable": true,
"type": "string"
},
"reason": {
"nullable": true,
"type": "string"
},
"status": {
"nullable": true,
"type": "string"
},
"type": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"namespace": {
"nullable": true,
"type": "string"
},
"observedGeneration": {
"type": "integer"
},
"podCreated": {
"type": "boolean"
},
"podName": {
"nullable": true,
"type": "string"
},
"podNamespace": {
"nullable": true,
"type": "string"
},
"projectId": {
"nullable": true,
"type": "string"
},
"releaseName": {
"nullable": true,
"type": "string"
},
"token": {
"nullable": true,
"type": "string"
},
"tolerations": {
"items": {
"properties": {
"effect": {
"nullable": true,
"type": "string"
},
"key": {
"nullable": true,
"type": "string"
},
"operator": {
"nullable": true,
"type": "string"
},
"tolerationSeconds": {
"nullable": true,
"type": "integer"
},
"value": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"nullable": true,
"type": "array"
},
"version": {
"nullable": true,
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
@@ -0,0 +1,84 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"plugin": {
"properties": {
"compressedEndpoint": {
"type": "string"
},
"endpoint": {
"type": "string"
},
"metadata": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"name": {
"type": "string"
},
"noAuth": {
"default": false,
"type": "boolean"
},
"noCache": {
"default": false,
"type": "boolean"
},
"version": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"status": {
"properties": {
"cacheState": {
"nullable": true,
"type": "string"
},
"error": {
"type": "string"
},
"observedGeneration": {
"format": "int64",
"type": "integer"
},
"ready": {
"default": false,
"type": "boolean"
},
"retryAt": {
"format": "date-time",
"type": "string"
},
"retryNumber": {
"type": "integer"
}
},
"required": [
"observedGeneration"
],
"type": "object"
}
},
"required": [
"spec"
],
"type": "object"
}