Files
argocd-apps/schemas/cluster.x-k8s.io/machinehealthcheck_v1beta1.json
unkinben 784c3b5de1 Add JSON schema generation for kubeconform CRD validation (#212)
## Summary
- New `ci/generate-schemas.sh` script that generates JSON schemas from three sources:
  1. Live cluster CRDs via `kubectl get crds`
  2. Offline CRD manifests (ArgoCD v3.3.2, Gateway API v1.5.1)
  3. Kubernetes v1.33.7 swagger spec for native types
- Schemas follow Datree catalog convention (`<group>/<Kind>_<version>.json`)
- `validate-apps.sh` and `validate-clusters.sh` check local schemas first, falling back to remote
- Fixes TLSRoute (and other CRD) schema validation failures in kubeconform

## Sources
- ArgoCD: `artifactapi.../argoproj/argo-cd/refs/tags/v3.3.2/manifests/ha/install.yaml`
- Gateway API: `artifactapi.../kubernetes-sigs/gateway-api/releases/download/v1.5.1/standard-install.yaml`
- Kubernetes: `artifactapi.../kubernetes/kubernetes/refs/tags/v1.33.7/api/openapi-spec/swagger.json`

Reviewed-on: #212
Co-authored-by: Ben Vincent <ben@unkin.net>
Co-committed-by: Ben Vincent <ben@unkin.net>
2026-06-28 17:26:08 +10:00

269 lines
6.8 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"clusterName": {
"maxLength": 63,
"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"
},
"maxItems": 100,
"type": "array"
},
"unhealthyRange": {
"maxLength": 32,
"minLength": 1,
"pattern": "^\\[[0-9]+-[0-9]+\\]$",
"type": "string"
}
},
"required": [
"clusterName",
"selector"
],
"type": "object"
},
"status": {
"properties": {
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"format": "date-time",
"type": "string"
},
"message": {
"maxLength": 10240,
"minLength": 1,
"type": "string"
},
"reason": {
"maxLength": 256,
"minLength": 1,
"type": "string"
},
"severity": {
"maxLength": 32,
"type": "string"
},
"status": {
"type": "string"
},
"type": {
"maxLength": 256,
"minLength": 1,
"type": "string"
}
},
"required": [
"lastTransitionTime",
"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": {
"maxLength": 253,
"minLength": 1,
"type": "string"
},
"maxItems": 10000,
"type": "array"
},
"v1beta2": {
"properties": {
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"format": "date-time",
"type": "string"
},
"message": {
"maxLength": 32768,
"type": "string"
},
"observedGeneration": {
"format": "int64",
"minimum": 0,
"type": "integer"
},
"reason": {
"maxLength": 1024,
"minLength": 1,
"pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
"type": "string"
},
"status": {
"enum": [
"True",
"False",
"Unknown"
],
"type": "string"
},
"type": {
"maxLength": 316,
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
"type": "string"
}
},
"required": [
"lastTransitionTime",
"message",
"reason",
"status",
"type"
],
"type": "object"
},
"maxItems": 32,
"type": "array",
"x-kubernetes-list-map-keys": [
"type"
],
"x-kubernetes-list-type": "map"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
}