Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MTV-567] Add plan support for OVA providers #619

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions packages/legacy/src/Plans/components/Wizard/TypeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export const TypeForm: React.FunctionComponent<ITypeFormProps> = ({
const isSourceOvirtInsecure = checkIfOvirtInsecureProvider(sourceProvider, secretsQuery.data);
const isSourceOpenstack = sourceProvider?.type === 'openstack';
const isSourceOCP = sourceProvider?.type === 'openshift';
const isSourceOVA = sourceProvider?.type === 'ova';
const isDisabled = isSourceOvirtInsecure || isSourceOpenstack || isSourceOCP || isSourceOVA;

return (
<ResolvedQueries results={[secretsQuery]} errorTitles={['Cannot load provider secrets']}>
Expand Down Expand Up @@ -60,18 +62,11 @@ export const TypeForm: React.FunctionComponent<ITypeFormProps> = ({
</StackItem>
)}

{isSourceOpenstack && (
{!isSourceOvirtInsecure && isDisabled && (
<StackItem>
<Alert variant="warning" isInline title="Warm migration is not currently available.">
Warm migrations from {PROVIDER_TYPE_NAMES.openstack} source providers are unsupported.
</Alert>
</StackItem>
)}

{isSourceOCP && (
<StackItem>
<Alert variant="warning" isInline title="Warm migration is not currently available.">
Warm migrations from {PROVIDER_TYPE_NAMES.openshift} source providers are unsupported.
Warm migrations from {PROVIDER_TYPE_NAMES?.[sourceProvider?.type]} source providers
are unsupported.
</Alert>
</StackItem>
)}
Expand All @@ -81,7 +76,7 @@ export const TypeForm: React.FunctionComponent<ITypeFormProps> = ({
id="migration-type-warm"
name="migration-type"
label="Warm migration"
isDisabled={isSourceOvirtInsecure || isSourceOpenstack || isSourceOCP}
isDisabled={isDisabled}
description={
<List>
<ListItem>VM data is incrementally copied, leaving source VMs running.</ListItem>
Expand All @@ -92,7 +87,7 @@ export const TypeForm: React.FunctionComponent<ITypeFormProps> = ({
</List>
}
body={
!(isSourceOvirtInsecure || isSourceOpenstack || isSourceOCP) && (
!isDisabled && (
<>
{isAnalyzingVms && (
<div className={`${spacing.mtMd} ${spacing.mlXs}`}>
Expand Down
3 changes: 3 additions & 0 deletions packages/legacy/src/queries/storages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const useSourceStoragesQuery = (
if (provider?.type === 'openshift') {
return '/storageclasses?detail=1';
}
if (provider?.type === 'ova') {
return '/disks?detail=1';
}
return '/storagedomains';
};
const mockStorage = (provider: SourceInventoryProvider) => {
Expand Down