feat(forklift): Applied fix to select the proper data on network. Added condition to show critical

Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
This commit is contained in:
Marcelo Fukumoto 2026-05-11 17:08:12 +02:00
parent d4f59a04be
commit 740ca94841
No known key found for this signature in database
GPG Key ID: 1CA12189625C2543
3 changed files with 46 additions and 4 deletions

View File

@ -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;

View File

@ -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,
},
};
}),

View File

@ -262,7 +262,7 @@ init();
</div>
</div>
</div>
<span v-else>-</span>
<span v-if="!row.vmProgress.length">-</span>
</template>
<template #cell:mappings="{ row }">
<MappingsCell