From ff76b74310fe448f1170fe38f0a0909741f0e492 Mon Sep 17 00:00:00 2001 From: yzamir Date: Thu, 30 Mar 2023 11:14:38 +0300 Subject: [PATCH] Disable openstack warm migration Signed-off-by: yzamir --- .../src/Plans/components/Wizard/TypeForm.tsx | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx b/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx index ab8e5f2ae..261c213ba 100644 --- a/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx +++ b/packages/legacy/src/Plans/components/Wizard/TypeForm.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Alert, Button, List, ListItem, Radio, Stack, StackItem, WizardContext } from '@patternfly/react-core'; +import { Alert, List, ListItem, Radio, Stack, StackItem } from '@patternfly/react-core'; import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing'; import { PlanWizardFormState } from './PlanWizard'; import { warmCriticalConcerns, someVMHasConcern } from './helpers'; @@ -23,8 +23,6 @@ export const TypeForm: React.FunctionComponent = ({ selectedVMs, namespace, }: ITypeFormProps) => { - const { goToStepById } = React.useContext(WizardContext); - const warmCriticalConcernsFound = warmCriticalConcerns.filter((label) => someVMHasConcern(selectedVMs, label) ); @@ -32,6 +30,7 @@ export const TypeForm: React.FunctionComponent = ({ const secretsQuery = useSecretsQuery([sourceProvider.object?.spec?.secret?.name], namespace); const isSourceOvirtInsecure = checkIfOvirtInsecureProvider(sourceProvider, secretsQuery.data); + const isSourceOpenstack = sourceProvider?.type === 'openstack'; return ( = ({ + Warm migration from {PROVIDER_TYPE_NAMES.ovirt} source provider is only supported + with a verified secure connection. + + + )} + + {isSourceOpenstack && ( + + - A warm migration from a {PROVIDER_TYPE_NAMES.ovirt} source provider is only supported - with a verified secure connection. To enable a warm migration, first select a secure provider - on the . + Warm migration from {PROVIDER_TYPE_NAMES.openstack} source provider is unsupported. )} @@ -73,7 +83,7 @@ export const TypeForm: React.FunctionComponent = ({ id="migration-type-warm" name="migration-type" label="Warm migration" - isDisabled={isSourceOvirtInsecure} + isDisabled={isSourceOvirtInsecure || isSourceOpenstack} description={ VM data is incrementally copied, leaving source VMs running. @@ -83,7 +93,7 @@ export const TypeForm: React.FunctionComponent = ({ } - body={ + body={!(isSourceOvirtInsecure || isSourceOpenstack) && <> {isAnalyzingVms && (