Skip to content

Commit b8111f0

Browse files
fix: reword the error message to focus on bootable volume (#736) (#738)
(cherry picked from commit a9c392c) Signed-off-by: Tim Liou <tim.liou@suse.com> Co-authored-by: Tim Liou <tim.liou@suse.com>
1 parent 6d627f8 commit b8111f0

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

pkg/harvester/l10n/en-us.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ harvester:
428428
volume:
429429
upperType: Volume name
430430
lowerType: volume name
431-
needImageOrExisting: 'At least an image volume or an existing root-disk volume is required!'
431+
needAtLeastOneBootable: 'At least one bootable volume is required!'
432432
image:
433433
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.'
434434
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.'
@@ -1356,7 +1356,7 @@ harvester:
13561356
clusterRegistrationUrl:
13571357
url: URL
13581358
insecureSkipTLSVerify: Insecure Skip TLS Verify
1359-
tip:
1359+
tip:
13601360
prefix: Harvester secures cluster registration via TLS by default. If opt out "Insecure SKip TLS Verify", you must provide custom CA certificates using the
13611361
middle: 'additional-ca'
13621362
suffix: setting.
@@ -2190,12 +2190,12 @@ typeLabel:
21902190
other { VMware Sources }
21912191
}
21922192
migration.harvesterhci.io.ovasource: |-
2193-
{count, plural,
2193+
{count, plural,
21942194
one { OVA Source }
21952195
other { OVA Sources }
2196-
}
2196+
}
21972197
migration.harvesterhci.io.virtualmachineimport: |-
21982198
{count, plural,
21992199
one { Virtual Machine Import }
22002200
other { Virtual Machine Imports }
2201-
}
2201+
}

pkg/harvester/validators/vm.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ export function vmDisks(spec, getters, errors, validatorArgs, displayKey, value)
6969
validName(getters, errors, D.name, diskNames, prefix, type, lowerType, upperType);
7070
});
7171

72-
let requiredVolume = false;
72+
let hasBootableVolume = false;
7373

7474
_volumes.forEach((V, idx) => {
7575
const { type, typeValue } = getVolumeType(getters, V, _volumeClaimTemplates, value);
7676

7777
const prefix = V.name || idx + 1;
7878

7979
if ([SOURCE_TYPE.IMAGE, SOURCE_TYPE.ATTACH_VOLUME, SOURCE_TYPE.CONTAINER].includes(type)) {
80-
requiredVolume = true;
80+
hasBootableVolume = true;
8181
}
8282

8383
if (type === SOURCE_TYPE.NEW || type === SOURCE_TYPE.IMAGE) {
@@ -137,10 +137,10 @@ export function vmDisks(spec, getters, errors, validatorArgs, displayKey, value)
137137
});
138138

139139
/**
140-
* At least one volume must be create. (Verify only when create.)
140+
* At least one bootable volume must be provided. (Verify only when create.)
141141
*/
142-
if ((!requiredVolume || _volumes.length === 0) && !value.links) {
143-
errors.push(getters['i18n/t']('harvester.validation.vm.volume.needImageOrExisting'));
142+
if (!hasBootableVolume && !value.links) {
143+
errors.push(getters['i18n/t']('harvester.validation.vm.volume.needAtLeastOneBootable'));
144144
}
145145

146146
return errors;

0 commit comments

Comments
 (0)