From 6c278441a722f61e535ac828b0bac4a36a6eece5 Mon Sep 17 00:00:00 2001 From: Montse Ortega Date: Mon, 31 Jul 2023 16:34:47 +0200 Subject: [PATCH] MGMT-15380: Not set userManagedNetworking=true when user select arm64 as cpu architecture (#2280) * Not set userManagedNetworking=true when user select arm64 * Removing console.log * Set UMN = true only when CMN is not supported according to the API --------- Co-authored-by: Jonathan Kilzi --- .../OcmClusterDetailsFormFields.tsx | 14 +++++++++++++- .../lib/ocm/services/ClusterDetailsService.ts | 3 ++- libs/ui-lib/lib/ocm/services/types.ts | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libs/ui-lib/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx b/libs/ui-lib/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx index 7a5fef1fe0..9be161da8d 100644 --- a/libs/ui-lib/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx @@ -39,6 +39,7 @@ import { ExternalPlatformDropdown, ExternalPlatformType } from './ExternalPlatfo import { useOracleDropdownItemState } from '../../hooks/useOracleDropdownItemState'; import { useClusterWizardContext } from '../clusterWizard/ClusterWizardContext'; import { HostsNetworkConfigurationType } from '../../services/types'; +import { useNewFeatureSupportLevel } from '../../../common/components/newFeatureSupportLevels'; export type OcmClusterDetailsFormFieldsProps = { forceOpenshiftVersion?: string; @@ -108,7 +109,7 @@ export const OcmClusterDetailsFormFields = ({ featureSupportLevelData, values.cpuArchitecture, ); - + const featureSupportLevelContext = useNewFeatureSupportLevel(); React.useEffect(() => { nameInputRef.current?.focus(); }, []); @@ -136,6 +137,17 @@ export const OcmClusterDetailsFormFields = ({ [clusterWizardContext, setFieldValue], ); + React.useEffect(() => { + setFieldValue( + 'isCMNSupported', + featureSupportLevelContext.isFeatureSupported( + 'CLUSTER_MANAGED_NETWORKING', + featureSupportLevelData ?? undefined, + ), + false, + ); + }, [setFieldValue, featureSupportLevelContext, featureSupportLevelData]); + return (