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>
This commit was merged in pull request #212.
This commit is contained in:
@@ -0,0 +1,315 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object"
|
||||
},
|
||||
"spec": {
|
||||
"properties": {
|
||||
"config": {
|
||||
"type": "object",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"configRef": {
|
||||
"properties": {
|
||||
"secretName": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"count": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"elasticsearchRef": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"namespace": {
|
||||
"type": "string"
|
||||
},
|
||||
"secretName": {
|
||||
"type": "string"
|
||||
},
|
||||
"serviceName": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"http": {
|
||||
"properties": {
|
||||
"service": {
|
||||
"properties": {
|
||||
"metadata": {
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"finalizers": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"labels": {
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"namespace": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"spec": {
|
||||
"properties": {
|
||||
"allocateLoadBalancerNodePorts": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"clusterIP": {
|
||||
"type": "string"
|
||||
},
|
||||
"clusterIPs": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array",
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"externalIPs": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array",
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"externalName": {
|
||||
"type": "string"
|
||||
},
|
||||
"externalTrafficPolicy": {
|
||||
"type": "string"
|
||||
},
|
||||
"healthCheckNodePort": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"internalTrafficPolicy": {
|
||||
"type": "string"
|
||||
},
|
||||
"ipFamilies": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array",
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"ipFamilyPolicy": {
|
||||
"type": "string"
|
||||
},
|
||||
"loadBalancerClass": {
|
||||
"type": "string"
|
||||
},
|
||||
"loadBalancerIP": {
|
||||
"type": "string"
|
||||
},
|
||||
"loadBalancerSourceRanges": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array",
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"ports": {
|
||||
"items": {
|
||||
"properties": {
|
||||
"appProtocol": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"nodePort": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"port": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"protocol": {
|
||||
"default": "TCP",
|
||||
"type": "string"
|
||||
},
|
||||
"targetPort": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"x-kubernetes-int-or-string": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"port"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "array",
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"port",
|
||||
"protocol"
|
||||
],
|
||||
"x-kubernetes-list-type": "map"
|
||||
},
|
||||
"publishNotReadyAddresses": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"selector": {
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "object",
|
||||
"x-kubernetes-map-type": "atomic"
|
||||
},
|
||||
"sessionAffinity": {
|
||||
"type": "string"
|
||||
},
|
||||
"sessionAffinityConfig": {
|
||||
"properties": {
|
||||
"clientIP": {
|
||||
"properties": {
|
||||
"timeoutSeconds": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"trafficDistribution": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"tls": {
|
||||
"properties": {
|
||||
"certificate": {
|
||||
"properties": {
|
||||
"secretName": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"selfSignedCertificate": {
|
||||
"properties": {
|
||||
"disabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"subjectAltNames": {
|
||||
"items": {
|
||||
"properties": {
|
||||
"dns": {
|
||||
"type": "string"
|
||||
},
|
||||
"ip": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"image": {
|
||||
"type": "string"
|
||||
},
|
||||
"podTemplate": {
|
||||
"type": "object",
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"revisionHistoryLimit": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"serviceAccountName": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"version"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"status": {
|
||||
"properties": {
|
||||
"associationStatus": {
|
||||
"type": "string"
|
||||
},
|
||||
"availableNodes": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"count": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"health": {
|
||||
"type": "string"
|
||||
},
|
||||
"observedGeneration": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"selector": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
Reference in New Issue
Block a user