mirror of
https://github.com/cozystack/cozystack.git
synced 2026-10-30 00:27:04 +09:00
Immediate binding for every source fixed a real bug: a standalone disk on a WaitForFirstConsumer class has no consumer to wait for, so it never populated. It also took away the path that is correct for the other case. For a disk a VMInstance consumes, KubeVirt renders a temporary launcher pod carrying the VM's own affinity and nodeSelector, so the volume binds where the VM can actually run; with the annotation always present the CDI worker becomes the first consumer instead and the volume lands where that pod happened to be scheduled. On a node-pinned class the VM is then unschedulable against a node-affinity conflict, and storageClass is immutable, so the only exit is deleting the disk. The two cases want opposite defaults and only the operator knows which one a given disk is. bindImmediately defaults to true, so nothing moves for existing disks or for anyone on `replicated`, which binds Immediate either way. Both branches are pinned in tests, including the existing-DataVolume path, which renders its own annotation block. Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com> Assisted-By: LLM
40 lines
1.4 KiB
YAML
40 lines
1.4 KiB
YAML
##
|
|
## @section Common parameters
|
|
##
|
|
|
|
## @typedef {struct} SourceImage - Use image by name.
|
|
## @field {string} name - Name of the image to use.
|
|
## @x-cozystack-options {source: image}
|
|
|
|
## @typedef {struct} SourceUpload - Upload local image.
|
|
|
|
## @typedef {struct} SourceHTTP - Download image from an HTTP source.
|
|
## @field {string} url - URL to download the image.
|
|
|
|
## @typedef {struct} SourceDisk - Clone an existing vm-disk.
|
|
## @field {string} name - Name of the vm-disk to clone.
|
|
|
|
## @typedef {struct} Source - The source image location used to create a disk.
|
|
## @field {*SourceImage} [image] - Use image by name from default collection.
|
|
## @field {*SourceUpload} [upload] - Upload local image.
|
|
## @field {*SourceHTTP} [http] - Download image from an HTTP source.
|
|
## @field {*SourceDisk} [disk] - Clone an existing vm-disk.
|
|
|
|
## @param {Source} source - The source image location used to create a disk.
|
|
## @immutable
|
|
source: {}
|
|
|
|
## @param {bool} optical - Defines if disk should be considered optical.
|
|
optical: false
|
|
|
|
## @param {quantity} storage - The size of the disk allocated for the virtual machine.
|
|
storage: 5Gi
|
|
|
|
## @param {string} storageClass - StorageClass used to store the data.
|
|
## @immutable
|
|
## @x-cozystack-options {source: storageclass}
|
|
storageClass: replicated
|
|
|
|
## @param {bool} bindImmediately - Provision the volume at disk creation instead of waiting for a consumer.
|
|
bindImmediately: true
|