From 740ca9484188b17b93e9c13a1e231c21a10f960c Mon Sep 17 00:00:00 2001 From: Marcelo Fukumoto Date: Mon, 11 May 2026 17:08:12 +0200 Subject: [PATCH] feat(forklift): Applied fix to select the proper data on network. Added condition to show critical Signed-off-by: Marcelo Fukumoto --- .../models/forklift.konveyor.io.plan.js | 40 ++++++++++++++++++- .../_cluster/forklift/configure-mappings.vue | 8 +++- .../pages/c/_cluster/forklift/index.vue | 2 +- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/pkg/harvester/models/forklift.konveyor.io.plan.js b/pkg/harvester/models/forklift.konveyor.io.plan.js index 1632272d..21473435 100644 --- a/pkg/harvester/models/forklift.konveyor.io.plan.js +++ b/pkg/harvester/models/forklift.konveyor.io.plan.js @@ -8,6 +8,36 @@ export default class ForkliftPlan extends HarvesterResource { return conditions.some((c) => c.type === 'Failed' && c.status === 'True'); } + get planCritical() { + const conditions = this.status?.conditions || []; + + return conditions.some((c) => c.category === 'Critical' && c.status === 'True'); + } + + get criticalMessages() { + const conditions = this.status?.conditions || []; + + return conditions + .filter((c) => c.category === 'Critical' && c.status === 'True') + .map((c) => c.message); + } + + get stateDescription() { + if (this.planCritical) { + return this.criticalMessages.join('; '); + } + + return null; + } + + get stateObj() { + return { + error: this.planFailed || this.planCritical, + transitioning: this.isMigrating, + message: this.stateDescription, + }; + } + get isMigrating() { const migration = this.status?.migration; @@ -38,6 +68,10 @@ export default class ForkliftPlan extends HarvesterResource { return 'Error'; } + if (this.planCritical) { + return 'Error'; + } + if (this.planCanceled) { return 'Canceled'; } @@ -54,6 +88,10 @@ export default class ForkliftPlan extends HarvesterResource { return 'bg-error'; } + if (this.planCritical) { + return 'bg-error'; + } + if (this.planCanceled) { return 'bg-warning'; } @@ -67,7 +105,7 @@ export default class ForkliftPlan extends HarvesterResource { get _availableActions() { const canStop = this.isMigrating && !this.planCanceled; - const canStart = !this.planSucceeded && (!this.isMigrating || this.planFailed || this.planCanceled); + const canStart = !this.planSucceeded && (!this.isMigrating || this.planFailed || this.planCanceled || this.planCritical); const out = super._availableActions; diff --git a/pkg/harvester/pages/c/_cluster/forklift/configure-mappings.vue b/pkg/harvester/pages/c/_cluster/forklift/configure-mappings.vue index 2732ddf9..30f10e29 100644 --- a/pkg/harvester/pages/c/_cluster/forklift/configure-mappings.vue +++ b/pkg/harvester/pages/c/_cluster/forklift/configure-mappings.vue @@ -215,12 +215,16 @@ const saveMappings = async(buttonCb) => { }; } + const parts = entry.target.split('/'); + const netName = parts.length > 1 ? parts[1] : parts[0]; + const netNamespace = parts.length > 1 ? parts[0] : NAMESPACE; + return { source: { name: entry.name, id: entry.id }, destination: { type: 'multus', - name: entry.target, - namespace: NAMESPACE, + name: netName, + namespace: netNamespace, }, }; }), diff --git a/pkg/harvester/pages/c/_cluster/forklift/index.vue b/pkg/harvester/pages/c/_cluster/forklift/index.vue index b32de95f..916c6a3a 100644 --- a/pkg/harvester/pages/c/_cluster/forklift/index.vue +++ b/pkg/harvester/pages/c/_cluster/forklift/index.vue @@ -262,7 +262,7 @@ init(); - - + -