mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-22 08:37:38 +08:00
Update selected vGpus devices adding the provisioned devices
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
3 files changed
+17
-2
No files matched your search
@@ -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