Skip to content

Commit

Permalink
For VDDK help text - replace the example with a format
Browse files Browse the repository at this point in the history
Reference: https://issues.redhat.com/browse/MTV-1552

To avoid users from using the URL example which was provided for the Vsphere's
VDDK help text field, replace it with a format suggestion.

This is relevant for the create, edit, tooltip fields for all validaiton
statuses (error, success, default).

Signed-off-by: Sharon Gratch <[email protected]>
  • Loading branch information
sgratch committed Nov 19, 2024
1 parent de8df09 commit 621f86a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const validateVDDKImage = (vddkImage: string | number): ValidationMsg =>
// For a newly opened form where the field is not set yet, set the validation type to default.
if (vddkImage === undefined)
return {
msg: 'The VDDK image is empty, it is recommended to provide an image, for example: quay.io/kubev2v/vddk:latest .',
msg: 'The VDDK image is empty. It is recommended to provide an image in the format of <registry_route_or_server_path>/vddk:<tag> .',
type: 'default',
};

Expand All @@ -18,19 +18,19 @@ export const validateVDDKImage = (vddkImage: string | number): ValidationMsg =>

if (trimmedVddkImage === '')
return {
msg: 'The VDDK image is empty, it is recommended to provide an image, for example: quay.io/kubev2v/vddk:latest .',
msg: 'The VDDK image is empty. It is recommended to provide an image in the format of <registry_route_or_server_path>/vddk:<tag> .',
type: 'error',
};

if (!isValidTrimmedVddkImage) {
return {
type: 'error',
msg: 'The VDDK image is invalid. VDDK image should be a valid container image, for example: quay.io/kubev2v/vddk:latest .',
msg: 'The VDDK image is invalid. VDDK image should be a valid container image in the format of <registry_route_or_server_path>/vddk:<tag> .',
};
}

return {
type: 'success',
msg: 'VMware Virtual Disk Development Kit (VDDK) image, for example: quay.io/kubev2v/vddk:latest .',
msg: 'VMware Virtual Disk Development Kit (VDDK) image in the format of <registry_route_or_server_path>/vddk:<tag> .',
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function vsphereProviderValidator(provider: V1beta1Provider): ValidationM

if (emptyVddkInitImage === 'yes' && vddkInitImage === '') {
return {
msg: 'The VDDK image is empty, it is recommended to provide an image, for example: quay.io/kubev2v/vddk:latest .',
msg: 'The VDDK image is empty. It is recommended to provide an image in the format of <registry_route_or_server_path>/vddk:<tag> .',
type: 'warning',
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export const VDDKDetailsItem: React.FC<ProviderDetailsItemProps> = ({
valid container image path in the format of{' '}
<strong>registry_route_or_server_path/vddk:&#8249;tag&#8250;</strong>.<br />
<br />
For example: <strong>quay.io/kubev2v/example:latest</strong>.<br />
<br />
It is strongly recommended to specify a VDDK init image to accelerate migrations.
</ForkliftTrans>
);
Expand Down

0 comments on commit 621f86a

Please sign in to comment.