mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-08-16 12:49:14 +00:00
(cherry picked from commit 7c3b2730abb473a99375a972b85e9930b71cc330) Signed-off-by: Andy Lee <andy.lee@suse.com> Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
73e022172b
commit
e99e4ef34f
@ -487,7 +487,6 @@ harvester:
|
||||
volume:
|
||||
upperType: Volume name
|
||||
lowerType: volume name
|
||||
needAtLeastOneBootable: 'At least one bootable volume is required!'
|
||||
image:
|
||||
ruleTip: 'The URL you have entered ends in an extension that we do not support. We only accept image files that end in .img, .iso, .qcow, .qcow2, .raw.'
|
||||
ruleFileTip: 'The file you have chosen ends in an extension that we do not support. We only accept image files that end in .img, .iso, .qcow, .qcow2, .raw.'
|
||||
|
||||
@ -69,17 +69,11 @@ export function vmDisks(spec, getters, errors, validatorArgs, displayKey, value)
|
||||
validName(getters, errors, D.name, diskNames, prefix, type, lowerType, upperType);
|
||||
});
|
||||
|
||||
let hasBootableVolume = false;
|
||||
|
||||
_volumes.forEach((V, idx) => {
|
||||
const { type, typeValue } = getVolumeType(getters, V, _volumeClaimTemplates, value);
|
||||
|
||||
const prefix = V.name || idx + 1;
|
||||
|
||||
if ([SOURCE_TYPE.IMAGE, SOURCE_TYPE.ATTACH_VOLUME, SOURCE_TYPE.CONTAINER].includes(type)) {
|
||||
hasBootableVolume = true;
|
||||
}
|
||||
|
||||
if (type === SOURCE_TYPE.NEW || type === SOURCE_TYPE.IMAGE) {
|
||||
if (!/([1-9]|[1-9][0-9]+)[a-zA-Z]+/.test(typeValue?.spec?.resources?.requests?.storage)) {
|
||||
const key = getters['i18n/t']('harvester.fields.size');
|
||||
@ -136,13 +130,6 @@ export function vmDisks(spec, getters, errors, validatorArgs, displayKey, value)
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* At least one bootable volume must be provided. (Verify only when create.)
|
||||
*/
|
||||
if (!hasBootableVolume && !value.links) {
|
||||
errors.push(getters['i18n/t']('harvester.validation.vm.volume.needAtLeastOneBootable'));
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user