Skip to content

Commit

Permalink
fix: resume/active scheduling job failed
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <[email protected]>
(cherry picked from commit 814d296)
  • Loading branch information
a110605 authored and mergify[bot] committed Jan 10, 2025
1 parent 0f03fc0 commit 7d97e68
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/harvester/models/harvesterhci.io.schedulevmbackup.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 7d97e68

Please sign in to comment.