Skip to content

Commit

Permalink
Merge pull request #619 from yaacov/ova-plan-support
Browse files Browse the repository at this point in the history
[MTV-567] Add plan support for OVA providers
  • Loading branch information
yaacov committed Jul 27, 2023
2 parents 0bcaa5d + a2e1f45 commit 9497fda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
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

0 comments on commit 9497fda

Please sign in to comment.