Skip to content

Commit

Permalink
MGMT-15805: OpenshiftSDN is the default SDN selected when installing …
Browse files Browse the repository at this point in the history
…a new cluster [2.8-cim BACKPORT] (#2494)

* Make OVN the default netwokorking type

* Fix lint issues
  • Loading branch information
jgyselov authored Feb 21, 2024
1 parent e187529 commit 42f7de9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import {
canSelectNetworkTypeSDN,
ClusterDefaultConfig,
getDefaultNetworkType,
isAdvNetworkConf,
isSNO,
isSubnetInIPv6,
Expand Down Expand Up @@ -88,8 +87,6 @@ const NetworkConfiguration = ({

useEffect(() => {
if (!cluster.networkType) {
setFieldValue('networkType', getDefaultNetworkType(!isMultiNodeCluster, isIPv6));
} else if (!isSDNSelectable) {
setFieldValue('networkType', NETWORK_TYPE_OVN);
}
// Skipping "cluster.networkType" as it's ultimately the value we are setting in the form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import {
import {
getSubnetFromMachineNetworkCidr,
getHostSubnets,
isSubnetInIPv6,
getDefaultNetworkType,
} from '../../../common/components/clusterConfiguration/utils';
import {
isSNO,
Expand All @@ -22,7 +20,7 @@ import {
selectMachineNetworkCIDR,
selectServiceNetworkCIDR,
} from '../../../common/selectors/clusterSelectors';
import { NO_SUBNET_SET } from '../../../common/config';
import { NETWORK_TYPE_OVN, NO_SUBNET_SET } from '../../../common/config';

const getInitHostSubnet = (
cluster: Cluster,
Expand All @@ -45,8 +43,6 @@ export const getNetworkInitialValues = (
defaultNetworkSettings: ClusterDefaultConfig,
): NetworkConfigurationValues => {
const managedNetworkingType = cluster.userManagedNetworking ? 'userManaged' : 'clusterManaged';
const isIPv6 = isSubnetInIPv6(cluster);
const isSNOCluster = isSNO(cluster);

return {
clusterNetworkCidr:
Expand All @@ -61,7 +57,7 @@ export const getNetworkInitialValues = (
hostSubnet: getInitHostSubnet(cluster, managedNetworkingType) || NO_SUBNET_SET,
vipDhcpAllocation: cluster.vipDhcpAllocation,
managedNetworkingType,
networkType: cluster.networkType || getDefaultNetworkType(isSNOCluster, isIPv6),
networkType: cluster.networkType || NETWORK_TYPE_OVN,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ServiceNetwork,
stringToJSON,
} from '../../api';
import { NETWORK_TYPE_OVN, NETWORK_TYPE_SDN, NO_SUBNET_SET } from '../../config';
import { NO_SUBNET_SET } from '../../config';
import {
selectClusterNetworkCIDR,
selectClusterNetworkHostPrefix,
Expand Down Expand Up @@ -173,10 +173,6 @@ export const canSelectNetworkTypeSDN = (isSNO: boolean, isIPv6 = false) => {
return !(isSNO || isIPv6);
};

export const getDefaultNetworkType = (isSNO: boolean, isIPv6 = false) => {
return isSNO || isIPv6 ? NETWORK_TYPE_OVN : NETWORK_TYPE_SDN;
};

export const canBeDualStack = (subnets: HostSubnets) =>
subnets.some((subnet) => Address4.isValid(subnet.subnet)) &&
subnets.some((subnet) => Address6.isValid(subnet.subnet));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import {
Cluster,
clusterNetworksValidationSchema,
dualStackValidationSchema,
getDefaultNetworkType,
HostSubnets,
isDualStack,
isSNO,
machineNetworksValidationSchema,
NetworkConfigurationValues,
serviceNetworkValidationSchema,
Expand All @@ -15,6 +13,7 @@ import {
vipNoSuffixValidationSchema,
IPV4_STACK,
DUAL_STACK,
NETWORK_TYPE_OVN,
ClusterDefaultConfig,
} from '../../../../common';

Expand All @@ -28,7 +27,6 @@ export const getNetworkInitialValues = (
| 'serviceNetworksDualstack'
>,
): NetworkConfigurationValues => {
const isSNOCluster = isSNO(cluster);
const isDualStackType = isDualStack(cluster);

return {
Expand All @@ -37,7 +35,7 @@ export const getNetworkInitialValues = (
sshPublicKey: cluster.sshPublicKey || '',
vipDhcpAllocation: cluster.vipDhcpAllocation,
managedNetworkingType: cluster.userManagedNetworking ? 'userManaged' : 'clusterManaged',
networkType: cluster.networkType || getDefaultNetworkType(isSNOCluster, isDualStackType),
networkType: cluster.networkType || NETWORK_TYPE_OVN,
machineNetworks: cluster.machineNetworks || [],
stackType: isDualStackType ? DUAL_STACK : IPV4_STACK,
clusterNetworks:
Expand Down
2 changes: 1 addition & 1 deletion libs/ui-lib/lib/ocm/components/fetching/fetchEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const onFetchEvents: EventListFetchProps['onFetchEvents'] = async (
props,
onSuccess,
onError,
) => {
): Promise<void> => {
try {
EventsAPI.abort();
const response = await EventsAPI.list(props);
Expand Down

0 comments on commit 42f7de9

Please sign in to comment.