Add JSON schema generation for kubeconform CRD validation
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful

- 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
This commit is contained in:
2026-06-28 16:53:11 +10:00
parent cfca1e5278
commit 06c3c59ea2
565 changed files with 150484 additions and 0 deletions
@@ -0,0 +1,134 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"source": {
"properties": {
"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",
"x-kubernetes-validations": [
{
"message": "selector is immutable",
"rule": "self == oldSelf"
}
]
},
"volumeGroupSnapshotContentName": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "volumeGroupSnapshotContentName is immutable",
"rule": "self == oldSelf"
}
]
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "selector is required once set",
"rule": "!has(oldSelf.selector) || has(self.selector)"
},
{
"message": "volumeGroupSnapshotContentName is required once set",
"rule": "!has(oldSelf.volumeGroupSnapshotContentName) || has(self.volumeGroupSnapshotContentName)"
},
{
"message": "exactly one of selector and volumeGroupSnapshotContentName must be set",
"rule": "(has(self.selector) && !has(self.volumeGroupSnapshotContentName)) || (!has(self.selector) && has(self.volumeGroupSnapshotContentName))"
}
]
},
"volumeGroupSnapshotClassName": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "volumeGroupSnapshotClassName must not be the empty string when set",
"rule": "size(self) > 0"
}
]
}
},
"required": [
"source"
],
"type": "object"
},
"status": {
"properties": {
"boundVolumeGroupSnapshotContentName": {
"type": "string"
},
"creationTime": {
"format": "date-time",
"type": "string"
},
"error": {
"properties": {
"message": {
"type": "string"
},
"time": {
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"readyToUse": {
"type": "boolean"
}
},
"type": "object"
}
},
"required": [
"spec"
],
"type": "object"
}
@@ -0,0 +1,140 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"source": {
"properties": {
"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",
"x-kubernetes-validations": [
{
"message": "selector is immutable",
"rule": "self == oldSelf"
}
]
},
"volumeGroupSnapshotContentName": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "volumeGroupSnapshotContentName is immutable",
"rule": "self == oldSelf"
}
]
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "selector is required once set",
"rule": "!has(oldSelf.selector) || has(self.selector)"
},
{
"message": "volumeGroupSnapshotContentName is required once set",
"rule": "!has(oldSelf.volumeGroupSnapshotContentName) || has(self.volumeGroupSnapshotContentName)"
},
{
"message": "exactly one of selector and volumeGroupSnapshotContentName must be set",
"rule": "(has(self.selector) && !has(self.volumeGroupSnapshotContentName)) || (!has(self.selector) && has(self.volumeGroupSnapshotContentName))"
}
]
},
"volumeGroupSnapshotClassName": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "volumeGroupSnapshotClassName must not be the empty string when set",
"rule": "size(self) > 0"
}
]
}
},
"required": [
"source"
],
"type": "object"
},
"status": {
"properties": {
"boundVolumeGroupSnapshotContentName": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "boundVolumeGroupSnapshotContentName is immutable once set",
"rule": "self == oldSelf"
}
]
},
"creationTime": {
"format": "date-time",
"type": "string"
},
"error": {
"properties": {
"message": {
"type": "string"
},
"time": {
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"readyToUse": {
"type": "boolean"
}
},
"type": "object"
}
},
"required": [
"spec"
],
"type": "object"
}
@@ -0,0 +1,35 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"deletionPolicy": {
"enum": [
"Delete",
"Retain"
],
"type": "string"
},
"driver": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"type": "object"
}
},
"required": [
"deletionPolicy",
"driver"
],
"type": "object"
}
@@ -0,0 +1,53 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"deletionPolicy": {
"enum": [
"Delete",
"Retain"
],
"type": "string",
"x-kubernetes-validations": [
{
"message": "deletionPolicy is immutable once set",
"rule": "self == oldSelf"
}
]
},
"driver": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "driver is immutable once set",
"rule": "self == oldSelf"
}
]
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "parameters are immutable once set",
"rule": "self == oldSelf"
}
]
}
},
"required": [
"deletionPolicy",
"driver"
],
"type": "object"
}
@@ -0,0 +1,175 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"deletionPolicy": {
"enum": [
"Delete",
"Retain"
],
"type": "string"
},
"driver": {
"type": "string"
},
"source": {
"properties": {
"groupSnapshotHandles": {
"properties": {
"volumeGroupSnapshotHandle": {
"type": "string"
},
"volumeSnapshotHandles": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"volumeGroupSnapshotHandle",
"volumeSnapshotHandles"
],
"type": "object",
"x-kubernetes-validations": [
{
"message": "groupSnapshotHandles is immutable",
"rule": "self == oldSelf"
}
]
},
"volumeHandles": {
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-validations": [
{
"message": "volumeHandles is immutable",
"rule": "self == oldSelf"
}
]
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "volumeHandles is required once set",
"rule": "!has(oldSelf.volumeHandles) || has(self.volumeHandles)"
},
{
"message": "groupSnapshotHandles is required once set",
"rule": "!has(oldSelf.groupSnapshotHandles) || has(self.groupSnapshotHandles)"
},
{
"message": "exactly one of volumeHandles and groupSnapshotHandles must be set",
"rule": "(has(self.volumeHandles) && !has(self.groupSnapshotHandles)) || (!has(self.volumeHandles) && has(self.groupSnapshotHandles))"
}
]
},
"volumeGroupSnapshotClassName": {
"type": "string"
},
"volumeGroupSnapshotRef": {
"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",
"x-kubernetes-validations": [
{
"message": "both volumeGroupSnapshotRef.name and volumeGroupSnapshotRef.namespace must be set",
"rule": "has(self.name) && has(self.__namespace__)"
}
]
}
},
"required": [
"deletionPolicy",
"driver",
"source",
"volumeGroupSnapshotRef"
],
"type": "object"
},
"status": {
"properties": {
"creationTime": {
"format": "date-time",
"type": "string"
},
"error": {
"properties": {
"message": {
"type": "string"
},
"time": {
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"readyToUse": {
"type": "boolean"
},
"volumeGroupSnapshotHandle": {
"type": "string"
},
"volumeSnapshotHandlePairList": {
"items": {
"properties": {
"snapshotHandle": {
"type": "string"
},
"volumeHandle": {
"type": "string"
}
},
"required": [
"snapshotHandle",
"volumeHandle"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"required": [
"spec"
],
"type": "object"
}
@@ -0,0 +1,208 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"apiVersion": {
"type": "string"
},
"kind": {
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"properties": {
"deletionPolicy": {
"enum": [
"Delete",
"Retain"
],
"type": "string"
},
"driver": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "driver is immutable once set",
"rule": "self == oldSelf"
}
]
},
"source": {
"properties": {
"groupSnapshotHandles": {
"properties": {
"volumeGroupSnapshotHandle": {
"type": "string"
},
"volumeSnapshotHandles": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"volumeGroupSnapshotHandle",
"volumeSnapshotHandles"
],
"type": "object",
"x-kubernetes-validations": [
{
"message": "groupSnapshotHandles is immutable",
"rule": "self == oldSelf"
}
]
},
"volumeHandles": {
"items": {
"type": "string"
},
"type": "array",
"x-kubernetes-validations": [
{
"message": "volumeHandles is immutable",
"rule": "self == oldSelf"
}
]
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "volumeHandles is required once set",
"rule": "!has(oldSelf.volumeHandles) || has(self.volumeHandles)"
},
{
"message": "groupSnapshotHandles is required once set",
"rule": "!has(oldSelf.groupSnapshotHandles) || has(self.groupSnapshotHandles)"
},
{
"message": "exactly one of volumeHandles and groupSnapshotHandles must be set",
"rule": "(has(self.volumeHandles) && !has(self.groupSnapshotHandles)) || (!has(self.volumeHandles) && has(self.groupSnapshotHandles))"
}
]
},
"volumeGroupSnapshotClassName": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "volumeGroupSnapshotClassName is immutable once set",
"rule": "self == oldSelf"
}
]
},
"volumeGroupSnapshotRef": {
"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",
"x-kubernetes-validations": [
{
"message": "both volumeGroupSnapshotRef.name and volumeGroupSnapshotRef.namespace must be set",
"rule": "has(self.name) && has(self.__namespace__)"
},
{
"message": "volumeGroupSnapshotRef.name and volumeGroupSnapshotRef.namespace are immutable",
"rule": "self.name == oldSelf.name && self.__namespace__ == oldSelf.__namespace__"
},
{
"message": "volumeGroupSnapshotRef.uid is immutable once set",
"rule": "!has(oldSelf.uid) || (has(self.uid) && self.uid == oldSelf.uid)"
}
]
}
},
"required": [
"deletionPolicy",
"driver",
"source",
"volumeGroupSnapshotRef"
],
"type": "object"
},
"status": {
"properties": {
"creationTime": {
"format": "date-time",
"type": "string"
},
"error": {
"properties": {
"message": {
"type": "string"
},
"time": {
"format": "date-time",
"type": "string"
}
},
"type": "object"
},
"readyToUse": {
"type": "boolean"
},
"volumeGroupSnapshotHandle": {
"type": "string",
"x-kubernetes-validations": [
{
"message": "volumeGroupSnapshotHandle is immutable once set",
"rule": "self == oldSelf"
}
]
},
"volumeSnapshotInfoList": {
"items": {
"properties": {
"creationTime": {
"format": "int64",
"type": "integer"
},
"readyToUse": {
"type": "boolean"
},
"restoreSize": {
"format": "int64",
"type": "integer"
},
"snapshotHandle": {
"type": "string"
},
"volumeHandle": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"required": [
"spec"
],
"type": "object"
}