Files
argocd-apps/schemas/postgresql.cnpg.io/publication_v1.json
T
unkinben 2bd8fcc0c2
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful
Add JSON schema generation for kubeconform CRD validation
- 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)
2026-06-28 17:24:47 +10:00

155 lines
4.0 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"cluster": {
"properties": {
"name": {
"default": "",
"type": "string"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
},
"dbname": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "dbname is immutable",
"rule": "self == oldSelf"
}
]
},
"name": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "name is immutable",
"rule": "self == oldSelf"
}
]
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"publicationReclaimPolicy": {
"default": "retain",
"enum": [
"delete",
"retain"
],
"type": "string"
},
"target": {
"properties": {
"allTables": {
"type": "boolean",
"x-kubernetes-validations": [
{
"message": "allTables is immutable",
"rule": "self == oldSelf"
}
]
},
"objects": {
"items": {
"properties": {
"table": {
"properties": {
"columns": {
"items": {
"type": "string"
},
"type": "array"
},
"name": {
"type": "string"
},
"only": {
"type": "boolean"
},
"schema": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"tablesInSchema": {
"type": "string"
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "tablesInSchema and table are mutually exclusive",
"rule": "(has(self.tablesInSchema) && !has(self.table)) || (!has(self.tablesInSchema) && has(self.table))"
}
]
},
"maxItems": 100000,
"type": "array",
"x-kubernetes-validations": [
{
"message": "specifying a column list when the publication also publishes tablesInSchema is not supported",
"rule": "!(self.exists(o, has(o.table) && has(o.table.columns)) && self.exists(o, has(o.tablesInSchema)))"
}
]
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "allTables and objects are mutually exclusive",
"rule": "(has(self.allTables) && !has(self.objects)) || (!has(self.allTables) && has(self.objects))"
}
]
}
},
"required": [
"cluster",
"dbname",
"name",
"target"
],
"type": "object"
},
"status": {
"properties": {
"applied": {
"type": "boolean"
},
"message": {
"type": "string"
},
"observedGeneration": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}