From 71d3067354008bc79b1a678b5e31af239bc319d6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:39:01 +0800 Subject: [PATCH] feat: ensure the state is pending when perform cloning the efi (#730) (#734) * feat: ensure the state is pending when perform cloning the efi * feat: define harvesterhci.io/clone-backend-storage-status in labels-annotations.js --------- (cherry picked from commit a2486a7d389ff86760f8456a73ef2202ed06ca02) Signed-off-by: pohanhuang Co-authored-by: Po Han Huang --- pkg/harvester/config/labels-annotations.js | 1 + pkg/harvester/models/kubevirt.io.virtualmachine.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/harvester/config/labels-annotations.js b/pkg/harvester/config/labels-annotations.js index a04d5e0d..98c28c3c 100644 --- a/pkg/harvester/config/labels-annotations.js +++ b/pkg/harvester/config/labels-annotations.js @@ -28,6 +28,7 @@ export const HCI = { NODE_ROLE_CONTROL_PLANE: 'node-role.kubernetes.io/control-plane', NODE_ROLE_ETCD: 'node-role.harvesterhci.io/witness', PROMOTE_STATUS: 'harvesterhci.io/promote-status', + CLONE_BACKEND_STORAGE_STATUS: 'harvesterhci.io/clone-backend-storage-status', MIGRATION_STATE: 'harvesterhci.io/migrationState', VOLUME_CLAIM_TEMPLATE: 'harvesterhci.io/volumeClaimTemplates', IMAGE_NAME: 'harvesterhci.io/image-name', diff --git a/pkg/harvester/models/kubevirt.io.virtualmachine.js b/pkg/harvester/models/kubevirt.io.virtualmachine.js index 26830630..c31f5a90 100644 --- a/pkg/harvester/models/kubevirt.io.virtualmachine.js +++ b/pkg/harvester/models/kubevirt.io.virtualmachine.js @@ -770,11 +770,11 @@ export default class VirtVm extends HarvesterResource { } get isPending() { - if (this && + if ((this && !this.isVMExpectedRunning && this.isVMCreated && this.vmi?.status?.phase === VMIPhase.Pending - ) { + ) || (this.metadata?.annotations?.[HCI_ANNOTATIONS.CLONE_BACKEND_STORAGE_STATUS] === 'cloning')) { return { status: VMIPhase.Pending }; }