diff --git a/packages/forklift-console-plugin/src/modules/Plans/utils/helpers/getMigrationVmsCounts.ts b/packages/forklift-console-plugin/src/modules/Plans/utils/helpers/getMigrationVmsCounts.ts index 4d46b9100..e548cec37 100644 --- a/packages/forklift-console-plugin/src/modules/Plans/utils/helpers/getMigrationVmsCounts.ts +++ b/packages/forklift-console-plugin/src/modules/Plans/utils/helpers/getMigrationVmsCounts.ts @@ -18,13 +18,14 @@ export const getMigrationVmsCounts = (vms: V1beta1PlanStatusMigrationVms[]): Mig ); const vmsCompleted = vms.filter((vm) => vm?.completed); const vmsError = vms.filter((vm) => vm?.error); + const success = vmsCompleted.length - vmsError.length - vmsCanceled.length; return { completed: vmsCompleted.length, total: vms.length, canceled: vmsCanceled.length, error: vmsError.length, - success: vmsCompleted.length - vmsError.length - vmsCanceled.length, + success: success >= 0 ? success : 0, }; };