From 7d97e6821cdbd74415bd17b3cbe30a1087555aca Mon Sep 17 00:00:00 2001 From: "andy.lee" Date: Wed, 8 Jan 2025 14:58:30 +0800 Subject: [PATCH] fix: resume/active scheduling job failed Signed-off-by: andy.lee (cherry picked from commit 814d296d75e972c44c1721d202f84d068b97f175) --- .../models/harvesterhci.io.schedulevmbackup.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js b/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js index a25483be..758977be 100644 --- a/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js +++ b/pkg/harvester/models/harvesterhci.io.schedulevmbackup.js @@ -1,6 +1,4 @@ import HarvesterResource from './harvester'; -import { get } from '@shell/utils/object'; -import { findBy } from '@shell/utils/array'; import { colorForState, stateDisplay, STATES } from '@shell/plugins/dashboard-store/resource-class'; import { _CREATE } from '@shell/config/query-params'; import { ucFirst, escapeHtml } from '@shell/utils/string'; @@ -67,14 +65,7 @@ export default class ScheduleVmBackup extends HarvesterResource { } get state() { - const conditions = get(this, 'status.conditions'); - const isSuspended = findBy(conditions, 'type', 'BackupSuspend')?.status === 'True'; - - if (isSuspended) { - return STATES.suspended.label; - } - - return this.metadata.state.name; + return this.status?.suspended === true ? STATES.suspended.label : STATES.active.label; } get stateDescription() {