Skip to content

Commit 74bd4ee

Browse files
committed
feat(kubernetes): pass the VMI hotplug fallback flag to kubevirt-csi
The controller Deployment now sets --enable-vmi-hotplug-fallback explicitly. Its correct value is decided by the KubeVirt CR in packages/system/kubevirt, not by the tenant: it must stay true while that CR enables HotplugVolumes and turn false in the same change that drops the gate. Rendering it, with a note beside the gate in the CR pointing back here, keeps both sides of that coupling visible instead of leaving it to the binary's default. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent a54e821 commit 74bd4ee

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

‎packages/apps/kubernetes/templates/csi/deploy.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ spec:
3636
- "--infra-cluster-namespace=$(INFRACLUSTER_NAMESPACE)"
3737
- "--infra-cluster-labels=$(INFRACLUSTER_LABELS)"
3838
- "--run-node-service=false"
39+
# true only while packages/system/kubevirt enables HotplugVolumes:
40+
# without that gate virt-api rejects removevolume on a VM-owned VMI.
41+
- "--enable-vmi-hotplug-fallback=true"
3942
- "--v=5"
4043
ports:
4144
- name: healthz
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
suite: KubeVirt CSI controller VMI hotplug fallback
2+
3+
templates:
4+
- templates/csi/deploy.yaml
5+
6+
values:
7+
- values/common.yaml
8+
9+
release:
10+
name: test-k8s
11+
namespace: tenant-test
12+
13+
tests:
14+
# Pinned while packages/system/kubevirt keeps HotplugVolumes in the static
15+
# featureGates, so virt-api accepts the VMI-level removevolume. This test
16+
# does not read that CR; the two change together.
17+
- it: keeps the VMI hotplug fallback on while the KubeVirt CR enables HotplugVolumes
18+
documentSelector:
19+
path: kind
20+
value: Deployment
21+
asserts:
22+
- equal:
23+
path: spec.template.spec.containers[0].name
24+
value: csi-driver
25+
- contains:
26+
path: spec.template.spec.containers[0].args
27+
content: "--enable-vmi-hotplug-fallback=true"
28+
- notContains:
29+
path: spec.template.spec.containers[0].args
30+
content: "--enable-vmi-hotplug-fallback=false"

‎packages/system/kubevirt/templates/kubevirt-cr.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ spec:
101101
# HotplugVolumes: deprecated in 1.9, replaced by DeclarativeHotplugVolumes.
102102
# Kept because virt-api accepts kubevirt-csi's VMI-level removevolume on a
103103
# VM-owned VMI only while it is on — which also keeps the replacement inert.
104+
# Dropping it means setting --enable-vmi-hotplug-fallback=false in
105+
# packages/apps/kubernetes/templates/csi/deploy.yaml in the same change.
104106
- HotplugVolumes
105107
- ExpandDisks
106108
- LiveMigration

0 commit comments

Comments
 (0)