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 <vtheile@suse.com>
This commit is contained in:
Volker Theile 2026-06-24 15:36:31 +02:00 committed by GitHub
parent 135d520b8d
commit 34dfe4027e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
}