mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Update selected vGpus devices adding the provisioned devices
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -1098,6 +1098,16 @@ export default class VirtVm extends HarvesterResource {
|
||||
return this.spec?.template?.spec?.domain?.devices?.hostDevices || [];
|
||||
}
|
||||
|
||||
get provisionedVGpus() {
|
||||
try {
|
||||
const deviceAllocationDetails = JSON.parse(this.metadata?.annotations[HCI_ANNOTATIONS.VM_DEVICE_ALLOCATION_DETAILS] || '{}');
|
||||
|
||||
return deviceAllocationDetails?.gpus || {};
|
||||
} catch (error) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
setInstanceLabels(val) {
|
||||
if ( !this.spec?.template?.metadata?.labels ) {
|
||||
set(this, 'spec.template.metadata.labels', {});
|
||||
|
||||
Reference in New Issue
Block a user