fix: unable to attach Ti volume in create VM page (#513)

* fix: unable to attach Ti volume in create VM page

Signed-off-by: Andy Lee <andy.lee@suse.com>

* refactor: only consider Ti / Gi for attached volume

Signed-off-by: Andy Lee <andy.lee@suse.com>

---------

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee 2025-09-09 14:27:40 +08:00 committed by GitHub
parent 1b214b2b6f
commit 4e8cb31e9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -704,7 +704,7 @@ export default {
parseDiskRows(disk) {
const disks = [];
const volumes = [];
const diskNameLables = [];
const diskNameLabels = [];
const volumeClaimTemplates = [];
disk.forEach( (R, index) => {
@ -726,7 +726,7 @@ export default {
disks.push(_disk);
volumes.push(_volume);
diskNameLables.push(dataVolumeName);
diskNameLabels.push(dataVolumeName);
if (R.source !== SOURCE_TYPE.CONTAINER) {
volumeClaimTemplates.push(_dataVolumeTemplate);
@ -1043,7 +1043,9 @@ export default {
},
parseVolumeClaimTemplate(R, dataVolumeName) {
if (!String(R.size).includes('Gi') && R.size) {
const sizeString = String(R.size);
if (!(sizeString.includes('Gi') || sizeString.includes('Ti')) && R.size) {
R.size = `${ R.size }${ GIBIBYTE }`;
}