From a2e1f45f7bcd054ad88e3e8ef2f463dc40868008 Mon Sep 17 00:00:00 2001 From: yaacov Date: Thu, 27 Jul 2023 09:10:18 +0300 Subject: [PATCH] Add plan support for OVA providers Signed-off-by: yaacov --- .../src/Plans/components/Wizard/TypeForm.tsx | 19 +++++++------------ packages/legacy/src/queries/storages.ts | 3 +++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx b/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx index b49fd3204..14fac7153 100644 --- a/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx +++ b/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx @@ -32,6 +32,8 @@ export const TypeForm: React.FunctionComponent = ({ 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 ( @@ -60,18 +62,11 @@ export const TypeForm: React.FunctionComponent = ({ )} - {isSourceOpenstack && ( + {!isSourceOvirtInsecure && isDisabled && ( - Warm migrations from {PROVIDER_TYPE_NAMES.openstack} source providers are unsupported. - - - )} - - {isSourceOCP && ( - - - Warm migrations from {PROVIDER_TYPE_NAMES.openshift} source providers are unsupported. + Warm migrations from {PROVIDER_TYPE_NAMES?.[sourceProvider?.type]} source providers + are unsupported. )} @@ -81,7 +76,7 @@ export const TypeForm: React.FunctionComponent = ({ id="migration-type-warm" name="migration-type" label="Warm migration" - isDisabled={isSourceOvirtInsecure || isSourceOpenstack || isSourceOCP} + isDisabled={isDisabled} description={ VM data is incrementally copied, leaving source VMs running. @@ -92,7 +87,7 @@ export const TypeForm: React.FunctionComponent = ({ } body={ - !(isSourceOvirtInsecure || isSourceOpenstack || isSourceOCP) && ( + !isDisabled && ( <> {isAnalyzingVms && (
diff --git a/packages/legacy/src/queries/storages.ts b/packages/legacy/src/queries/storages.ts index 6510c328d..8a5e95cdb 100644 --- a/packages/legacy/src/queries/storages.ts +++ b/packages/legacy/src/queries/storages.ts @@ -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) => {