Files
cozystack/packages/apps/vm-disk/values.schema.json
T
Myasnikov Daniil 74ac18e042 feat(apps): mark objects whose children exclude each other atomic
The worker image of a node pool takes one of builtin and factory, a
vm-disk source one of disk, http, image and upload, and the oidc
customConfig of a kubernetes cluster and of a monitoring stack one of
config and secretRef, and each chart refuses a spec that sets two. An
installation default for one child merged into an application that
chose another built exactly that spec, and nothing warned at create
time. The x-kubernetes-map-type: atomic marker makes the defaults
merge replace the object whole. Nothing else reads it, so existing
applications render as before.

The marker stays off objects whose fields must be set together or sit
beside independent fields, where replacing the object whole would drop
a default the user did not mean to override. The chart guide says when
to use it and when not to.

The tests run the merge against the four real schemas, and one more
pins that a pair like resources cpu and memory still merges field by
field.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-11-27 07:39:01 +00:00

111 lines
3.3 KiB
JSON

{
"title": "Chart Values",
"type": "object",
"properties": {
"source": {
"description": "The source image location used to create a disk.",
"type": "object",
"default": {},
"properties": {
"disk": {
"description": "Clone an existing vm-disk.",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"description": "Name of the vm-disk to clone.",
"type": "string"
}
}
},
"http": {
"description": "Download image from an HTTP source.",
"type": "object",
"required": [
"url"
],
"properties": {
"url": {
"description": "URL to download the image.",
"type": "string"
}
}
},
"image": {
"description": "Use image by name from default collection.",
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"description": "Name of the image to use.",
"type": "string",
"x-cozystack-options": {
"source": "image"
}
}
}
},
"upload": {
"description": "Upload local image.",
"type": "object"
}
},
"x-kubernetes-validations": [
{
"rule": "self == oldSelf",
"message": "source is immutable"
}
],
"x-kubernetes-map-type": "atomic"
},
"optical": {
"description": "Defines if disk should be considered optical.",
"type": "boolean",
"default": false
},
"storage": {
"description": "The size of the disk allocated for the virtual machine.",
"default": "5Gi",
"pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-kubernetes-int-or-string": true
},
"storageClass": {
"description": "StorageClass used to store the data.",
"type": "string",
"default": "replicated",
"x-kubernetes-validations": [
{
"rule": "self == oldSelf",
"message": "storageClass is immutable"
}
],
"x-cozystack-options": {
"source": "storageclass"
}
},
"bindImmediately": {
"description": "Provision the volume at disk creation instead of waiting for a consumer.",
"type": "boolean",
"default": true
},
"schedulingClass": {
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
"type": "string",
"default": "",
"maxLength": 63
}
}
}