From 34dfe4027eab0a7e77d8531c3c4804f198ee0294 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Wed, 24 Jun 2026 15:36:31 +0200 Subject: [PATCH] fix: 'No Media' image selection removes 'harvesterhci.io/os' label from VM CR (#941) When editing a Virtual Machine's volumes, if the user selects 'No media' for the Image, the 'harvesterhci.io/os' label is incorrectly removed from the VM's metadata. Related to: https://github.com/harvester/harvester/issues/10947 Signed-off-by: Volker Theile --- pkg/harvester/mixins/harvester-vm/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/harvester/mixins/harvester-vm/index.js b/pkg/harvester/mixins/harvester-vm/index.js index 074019d7..cfa5ab3e 100644 --- a/pkg/harvester/mixins/harvester-vm/index.js +++ b/pkg/harvester/mixins/harvester-vm/index.js @@ -1742,7 +1742,7 @@ export default { const oldImageId = old[0]?.image; - if (this.isCreate && oldImageId === imageId && imageId) { + if (this.isCreate && oldImageId !== imageId && imageId && osType) { this.osType = osType; } }