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 all kubeconform skip lists — all resource types now have schemas
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"type": "object"
|
||||
},
|
||||
"spec": {
|
||||
"properties": {
|
||||
"active": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"addCloudCredential": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"builtin": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"checksum": {
|
||||
"maxLength": 128,
|
||||
"pattern": "^$|^[a-fA-F0-9]{32,128}$",
|
||||
"type": "string"
|
||||
},
|
||||
"displayName": {
|
||||
"maxLength": 57,
|
||||
"type": "string"
|
||||
},
|
||||
"externalId": {
|
||||
"type": "string"
|
||||
},
|
||||
"uiUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"type": "string"
|
||||
},
|
||||
"whitelistDomains": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"active",
|
||||
"url"
|
||||
],
|
||||
"type": "object",
|
||||
"x-kubernetes-validations": [
|
||||
{
|
||||
"message": "Checksum must be an md5, sha1, sha256, or sha512 digest.",
|
||||
"rule": "!has(self.checksum) || (self.checksum.size() in [0, 32, 40, 64, 128])"
|
||||
}
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"properties": {
|
||||
"appliedChecksum": {
|
||||
"type": "string"
|
||||
},
|
||||
"appliedDockerMachineVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"appliedURL": {
|
||||
"type": "string"
|
||||
},
|
||||
"conditions": {
|
||||
"items": {
|
||||
"properties": {
|
||||
"lastTransitionTime": {
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"lastUpdateTime": {
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"maxLength": 32768,
|
||||
"type": "string"
|
||||
},
|
||||
"reason": {
|
||||
"maxLength": 1024,
|
||||
"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": [
|
||||
"status",
|
||||
"type"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"spec"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
Reference in New Issue
Block a user