Skip to content

Commit

Permalink
MGMT-15380: Not set userManagedNetworking=true when user select arm64…
Browse files Browse the repository at this point in the history
… as cpu architecture (openshift-assisted#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 <jkilzi@redhat.com>
  • Loading branch information
2 people authored and rawagner committed Sep 13, 2023
1 parent a615bc7 commit 6c27844
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -108,7 +109,7 @@ export const OcmClusterDetailsFormFields = ({
featureSupportLevelData,
values.cpuArchitecture,
);

const featureSupportLevelContext = useNewFeatureSupportLevel();
React.useEffect(() => {
nameInputRef.current?.focus();
}, []);
Expand Down Expand Up @@ -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 (
<Form id="wizard-cluster-details__form">
<OcmRichInputField
Expand Down
3 changes: 2 additions & 1 deletion libs/ui-lib/lib/ocm/services/ClusterDetailsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ClusterDetailsService = {
},
};

if (params.cpuArchitecture === CpuArchitecture.ARM || params.platform?.type === 'oci') {
if (!values.isCMNSupported) {
params.userManagedNetworking = true;
}

Expand Down Expand Up @@ -115,6 +115,7 @@ const ClusterDetailsService = {
hostsNetworkConfigurationType,
addCustomManifest: false,
platform: platform === undefined ? 'none' : platform,
isCMNSupported: true,
};
},
};
Expand Down
1 change: 1 addition & 0 deletions libs/ui-lib/lib/ocm/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ export enum HostsNetworkConfigurationType {
export type OcmClusterDetailsValues = ClusterDetailsValues & {
hostsNetworkConfigurationType: HostsNetworkConfigurationType;
addCustomManifest: boolean;
isCMNSupported: boolean;
};

0 comments on commit 6c27844

Please sign in to comment.