feat: add restore failed message in VM state description (#448) (#449)

(cherry picked from commit 66eac965753c1f9f6b4fe1881483d56d579011bb)

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
mergify[bot] 2025-08-04 14:11:58 +08:00 committed by GitHub
parent 1aaa8f71c4
commit 1cd5e5ca7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1164,6 +1164,13 @@ export default class VirtVm extends HarvesterResource {
return this.t('harvester.virtualMachine.hotplug.restartVMMessage'); return this.t('harvester.virtualMachine.hotplug.restartVMMessage');
} }
const restoreConditions = this.restoreResource?.status?.conditions || [];
const restoreError = restoreConditions.find((s) => s.error === true && s.reason === 'Error' && s.type === 'Ready');
if (restoreError?.message) {
return restoreError.message;
}
return this.ingoreVMMessage ? '' : super.stateDescription; return this.ingoreVMMessage ? '' : super.stateDescription;
} }