fix: vGPU number not correct

Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit 26afffc2f1d9f86aad78f0be700853279a3c383d)
This commit is contained in:
andy.lee 2025-01-02 16:34:51 +08:00 committed by Mergify
parent def9e1a24e
commit 40dc31226b

View File

@ -46,10 +46,13 @@ export default {
this[key] = res[key];
}
uniq([
const vGpus = this.vm.isOff ? [
...(this.value?.domain?.devices?.gpus || []).map(({ name }) => name),
] : [
...Object.values(this.vm?.provisionedVGpus).reduce((acc, gpus) => [...acc, ...gpus], [])
]).forEach((name) => {
];
uniq(vGpus).forEach((name) => {
if (this.enabledDevices.find((device) => device?.metadata?.name === name)) {
this.selectedDevices.push(name);
}