Add JSON schema generation for kubeconform CRD validation
- ci/generate-schemas.sh generates schemas from CRD manifests and K8s swagger - Sources: ArgoCD v3.3.2, Gateway API v1.5.1, Kubernetes v1.33.7 - Optionally fetches live cluster CRDs via kubectl when available - Generated schemas committed to schemas/ for CI use - Run `make schemas` to regenerate after CRD version bumps - validate-apps.sh and validate-clusters.sh check local schemas first - Remove CustomResourceDefinition from kubeconform skip list
This commit is contained in:
@@ -0,0 +1,402 @@
|
||||
{
|
||||
"$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"
|
||||
},
|
||||
"failureDomains": {
|
||||
"items": {
|
||||
"maxLength": 256,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"maxItems": 100,
|
||||
"type": "array"
|
||||
},
|
||||
"minReadySeconds": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"providerIDList": {
|
||||
"items": {
|
||||
"maxLength": 512,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"maxItems": 10000,
|
||||
"type": "array"
|
||||
},
|
||||
"replicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"template": {
|
||||
"properties": {
|
||||
"metadata": {
|
||||
"properties": {
|
||||
"annotations": {
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"labels": {
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"spec": {
|
||||
"properties": {
|
||||
"bootstrap": {
|
||||
"properties": {
|
||||
"configRef": {
|
||||
"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"
|
||||
},
|
||||
"dataSecretName": {
|
||||
"maxLength": 253,
|
||||
"minLength": 0,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"clusterName": {
|
||||
"maxLength": 63,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"failureDomain": {
|
||||
"maxLength": 256,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"infrastructureRef": {
|
||||
"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"
|
||||
},
|
||||
"nodeDeletionTimeout": {
|
||||
"type": "string"
|
||||
},
|
||||
"nodeDrainTimeout": {
|
||||
"type": "string"
|
||||
},
|
||||
"nodeVolumeDetachTimeout": {
|
||||
"type": "string"
|
||||
},
|
||||
"providerID": {
|
||||
"maxLength": 512,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"readinessGates": {
|
||||
"items": {
|
||||
"properties": {
|
||||
"conditionType": {
|
||||
"maxLength": 316,
|
||||
"minLength": 1,
|
||||
"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"
|
||||
},
|
||||
"polarity": {
|
||||
"enum": [
|
||||
"Positive",
|
||||
"Negative"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"conditionType"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"maxItems": 32,
|
||||
"type": "array",
|
||||
"x-kubernetes-list-map-keys": [
|
||||
"conditionType"
|
||||
],
|
||||
"x-kubernetes-list-type": "map"
|
||||
},
|
||||
"version": {
|
||||
"maxLength": 256,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"bootstrap",
|
||||
"clusterName",
|
||||
"infrastructureRef"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"clusterName",
|
||||
"template"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"status": {
|
||||
"properties": {
|
||||
"availableReplicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"bootstrapReady": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"failureMessage": {
|
||||
"maxLength": 10240,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"failureReason": {
|
||||
"type": "string"
|
||||
},
|
||||
"infrastructureReady": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"nodeRefs": {
|
||||
"items": {
|
||||
"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"
|
||||
},
|
||||
"maxItems": 10000,
|
||||
"type": "array"
|
||||
},
|
||||
"observedGeneration": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
},
|
||||
"phase": {
|
||||
"enum": [
|
||||
"Pending",
|
||||
"Provisioning",
|
||||
"Provisioned",
|
||||
"Running",
|
||||
"ScalingUp",
|
||||
"ScalingDown",
|
||||
"Scaling",
|
||||
"Deleting",
|
||||
"Failed",
|
||||
"Unknown"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"readyReplicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"replicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"unavailableReplicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"v1beta2": {
|
||||
"properties": {
|
||||
"availableReplicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"readyReplicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"upToDateReplicas": {
|
||||
"format": "int32",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
Reference in New Issue
Block a user