@openshift-assisted/ui-lib 2.52.2 → 5.0.0-cim
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/cim/components/ClusterDeployment/NetworkConfiguration.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/NetworkConfiguration.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.d.ts +5 -0
- package/build/@types/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.d.ts.map +1 -0
- package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts +4 -4
- package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts.map +1 -1
- package/build/@types/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts +2 -2
- package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.test.d.ts +2 -0
- package/build/@types/cim/components/helpers/versions.test.d.ts.map +1 -0
- package/build/@types/cim/components/modals/CimConfiguration/CimConfigurationModal.d.ts.map +1 -1
- package/build/@types/cim/components/modals/CimConfiguration/persist.d.ts +14 -17
- package/build/@types/cim/components/modals/CimConfiguration/persist.d.ts.map +1 -1
- package/build/@types/cim/types/k8s/agent-cluster-install.d.ts +1 -1
- package/build/@types/cim/types/k8s/agent-cluster-install.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/customManifests/CustomManifestsAlert.d.ts +6 -0
- package/build/@types/common/components/clusterWizard/customManifests/CustomManifestsAlert.d.ts.map +1 -0
- package/build/@types/common/components/clusterWizard/customManifests/index.d.ts +2 -0
- package/build/@types/common/components/clusterWizard/customManifests/index.d.ts.map +1 -0
- package/build/@types/common/components/clusterWizard/index.d.ts +2 -0
- package/build/@types/common/components/clusterWizard/index.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts +2 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts +2 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.d.ts +3 -0
- package/build/@types/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.d.ts.map +1 -0
- package/build/@types/common/components/clusterWizard/networkingSteps/index.d.ts +1 -0
- package/build/@types/common/components/clusterWizard/networkingSteps/index.d.ts.map +1 -1
- package/build/@types/common/components/ui/formik/utils.d.ts +1 -0
- package/build/@types/common/components/ui/formik/utils.d.ts.map +1 -1
- package/build/@types/common/config/constants.d.ts +2 -2
- package/build/@types/common/config/constants.d.ts.map +1 -1
- package/build/@types/common/types/networkType.d.ts +2 -1
- package/build/@types/common/types/networkType.d.ts.map +1 -1
- package/build/@types/common/validationSchemas/networkingValidation.d.ts +10 -0
- package/build/@types/common/validationSchemas/networkingValidation.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/review/ReviewSummary.d.ts.map +1 -1
- package/build/@types/ocm/components/{clusterDetail/ClusterProperties.d.ts → clusterConfiguration/review/utils.d.ts} +1 -8
- package/build/@types/ocm/components/clusterConfiguration/review/utils.d.ts.map +1 -0
- package/build/@types/ocm/components/clusterConfiguration/review/utils.test.d.ts +2 -0
- package/build/@types/ocm/components/clusterConfiguration/review/utils.test.d.ts.map +1 -0
- package/build/@types/ocm/components/clusterDetail/index.d.ts +0 -1
- package/build/@types/ocm/components/clusterDetail/index.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetailsForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusters/AssistedInstallerHeader.d.ts +5 -1
- package/build/@types/ocm/components/clusters/AssistedInstallerHeader.d.ts.map +1 -1
- package/build/@types/ocm/hooks/useClusterCustomManifests.d.ts.map +1 -1
- package/build/@types/ocm/hooks/useUISettings.d.ts.map +1 -1
- package/build/@types/ocm/services/ClusterDetailsService.d.ts +2 -1
- package/build/@types/ocm/services/ClusterDetailsService.d.ts.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js +46 -7
- package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.js +22 -21
- package/build/cjs/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +25 -9
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.js +35 -0
- package/build/cjs/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.js.map +1 -0
- package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js +13 -18
- package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/modals/NodePoolForm.js +1 -1
- package/build/cjs/cim/components/Hypershift/modals/NodePoolForm.js.map +1 -1
- package/build/cjs/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.js +1 -4
- package/build/cjs/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.js +39 -28
- package/build/cjs/cim/components/helpers/versions.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.test.js +423 -0
- package/build/cjs/cim/components/helpers/versions.test.js.map +1 -0
- package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js +39 -16
- package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js.map +1 -1
- package/build/cjs/cim/components/modals/CimConfiguration/persist.js +96 -136
- package/build/cjs/cim/components/modals/CimConfiguration/persist.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/customManifests/CustomManifestsAlert.js +32 -0
- package/build/cjs/common/components/clusterWizard/customManifests/CustomManifestsAlert.js.map +1 -0
- package/build/cjs/common/components/clusterWizard/customManifests/index.js +5 -0
- package/build/cjs/common/components/clusterWizard/customManifests/index.js.map +1 -0
- package/build/cjs/common/components/clusterWizard/index.js +2 -0
- package/build/cjs/common/components/clusterWizard/index.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js +8 -2
- package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js +2 -2
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js +29 -19
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.js +20 -0
- package/build/cjs/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.js.map +1 -0
- package/build/cjs/common/components/clusterWizard/networkingSteps/index.js +1 -0
- package/build/cjs/common/components/clusterWizard/networkingSteps/index.js.map +1 -1
- package/build/cjs/common/components/ui/formik/utils.js +5 -1
- package/build/cjs/common/components/ui/formik/utils.js.map +1 -1
- package/build/cjs/common/config/constants.js +13 -2
- package/build/cjs/common/config/constants.js.map +1 -1
- package/build/cjs/common/types/networkType.js +9 -8
- package/build/cjs/common/types/networkType.js.map +1 -1
- package/build/cjs/common/validationSchemas/networkingValidation.js +19 -1
- package/build/cjs/common/validationSchemas/networkingValidation.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js +4 -1
- package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js +1 -20
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js +6 -9
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js +4 -4
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.js +2 -2
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js +6 -5
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewSummary.js +5 -2
- package/build/cjs/ocm/components/clusterConfiguration/review/ReviewSummary.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/review/utils.js +57 -0
- package/build/cjs/ocm/components/clusterConfiguration/review/utils.js.map +1 -0
- package/build/cjs/ocm/components/{clusterDetail/ClusterProperties.test.js → clusterConfiguration/review/utils.test.js} +13 -13
- package/build/cjs/ocm/components/clusterConfiguration/review/utils.test.js.map +1 -0
- package/build/cjs/ocm/components/clusterDetail/index.js +1 -3
- package/build/cjs/ocm/components/clusterDetail/index.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js +10 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js.map +1 -1
- package/build/cjs/ocm/components/clusters/AssistedInstallerHeader.js +2 -2
- package/build/cjs/ocm/components/clusters/AssistedInstallerHeader.js.map +1 -1
- package/build/cjs/ocm/components/clusters/ClusterPage.js +1 -1
- package/build/cjs/ocm/components/clusters/ClusterPage.js.map +1 -1
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +1 -1
- package/build/cjs/ocm/hooks/useClusterCustomManifests.js +3 -15
- package/build/cjs/ocm/hooks/useClusterCustomManifests.js.map +1 -1
- package/build/cjs/ocm/hooks/useUISettings.js +1 -1
- package/build/cjs/ocm/hooks/useUISettings.js.map +1 -1
- package/build/cjs/ocm/services/ClusterDetailsService.js +4 -2
- package/build/cjs/ocm/services/ClusterDetailsService.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/NetworkConfiguration.tsx +55 -6
- package/lib/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.tsx +18 -2
- package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +22 -8
- package/lib/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.tsx +81 -0
- package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +14 -22
- package/lib/cim/components/Hypershift/modals/NodePoolForm.tsx +2 -2
- package/lib/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.tsx +2 -5
- package/lib/cim/components/helpers/versions.test.ts +465 -0
- package/lib/cim/components/helpers/versions.ts +37 -31
- package/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx +45 -18
- package/lib/cim/components/modals/CimConfiguration/persist.ts +97 -199
- package/lib/cim/types/k8s/agent-cluster-install.ts +1 -1
- package/lib/common/components/clusterWizard/customManifests/CustomManifestsAlert.tsx +39 -0
- package/lib/common/components/clusterWizard/customManifests/index.tsx +1 -0
- package/lib/common/components/clusterWizard/index.ts +2 -0
- package/lib/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.tsx +8 -1
- package/lib/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.tsx +2 -2
- package/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx +36 -26
- package/lib/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.tsx +28 -0
- package/lib/common/components/clusterWizard/networkingSteps/index.ts +1 -0
- package/lib/common/components/ui/formik/utils.ts +6 -0
- package/lib/common/config/constants.ts +14 -1
- package/lib/common/types/networkType.ts +9 -8
- package/lib/common/validationSchemas/networkingValidation.tsx +39 -1
- package/lib/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +6 -3
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx +10 -45
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +2 -2
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx +7 -24
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts +6 -5
- package/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx +1 -1
- package/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx +10 -4
- package/lib/ocm/components/clusterConfiguration/review/ReviewSummary.tsx +9 -2
- package/lib/ocm/components/{clusterDetail/ClusterProperties.test.ts → clusterConfiguration/review/utils.test.ts} +1 -1
- package/lib/ocm/components/clusterConfiguration/review/utils.tsx +61 -0
- package/lib/ocm/components/clusterDetail/index.ts +0 -1
- package/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx +10 -1
- package/lib/ocm/components/clusters/AssistedInstallerHeader.tsx +6 -2
- package/lib/ocm/components/clusters/ClusterPage.tsx +1 -1
- package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +1 -1
- package/lib/ocm/hooks/useClusterCustomManifests.ts +3 -0
- package/lib/ocm/hooks/useUISettings.ts +3 -1
- package/lib/ocm/services/ClusterDetailsService.ts +6 -0
- package/package.json +7 -7
- package/build/@types/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.d.ts +0 -7
- package/build/@types/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.d.ts +0 -8
- package/build/@types/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterDetail/ClusterProperties.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts +0 -2
- package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts.map +0 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js +0 -33
- package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +0 -1
- package/build/cjs/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js +0 -40
- package/build/cjs/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js.map +0 -1
- package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js +0 -77
- package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js.map +0 -1
- package/build/cjs/ocm/components/clusterDetail/ClusterProperties.test.js.map +0 -1
- package/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx +0 -74
- package/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx +0 -69
- package/lib/ocm/components/clusterDetail/ClusterProperties.tsx +0 -169
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useCallback } from 'react';
|
|
2
2
|
import { useFormikContext } from 'formik';
|
|
3
|
+
import isCIDR from 'is-cidr';
|
|
3
4
|
import { Checkbox, Grid } from '@patternfly/react-core';
|
|
4
5
|
import { NetworkConfigurationValues } from '../../../common/types/clusters';
|
|
5
6
|
import {
|
|
@@ -20,15 +21,17 @@ import {
|
|
|
20
21
|
NETWORK_TYPE_OVN,
|
|
21
22
|
} from '../../../common';
|
|
22
23
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
23
|
-
import {
|
|
24
|
+
import { NetworkTypeDropDown } from './networking/NetworkTypeDropdown';
|
|
24
25
|
import { ClusterDefaultConfig } from '@openshift-assisted/types/assisted-installer-service';
|
|
25
26
|
|
|
26
27
|
export type NetworkConfigurationProps = VirtualIPControlGroupProps & {
|
|
27
28
|
defaultNetworkSettings: Pick<
|
|
28
29
|
ClusterDefaultConfig,
|
|
29
30
|
| 'clusterNetworksIpv4'
|
|
31
|
+
| 'clusterNetworksIpv6'
|
|
30
32
|
| 'clusterNetworksDualstack'
|
|
31
33
|
| 'serviceNetworksIpv4'
|
|
34
|
+
| 'serviceNetworksIpv6'
|
|
32
35
|
| 'serviceNetworksDualstack'
|
|
33
36
|
>;
|
|
34
37
|
hideManagedNetworking?: boolean;
|
|
@@ -63,11 +66,23 @@ const NetworkConfiguration = ({
|
|
|
63
66
|
setAdvanced(checked);
|
|
64
67
|
|
|
65
68
|
if (!checked) {
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
const primaryCidr = values.machineNetworks?.[0]?.cidr;
|
|
70
|
+
const useIPv6Defaults = primaryCidr && isCIDR.v6(primaryCidr);
|
|
71
|
+
setFieldValue(
|
|
72
|
+
'clusterNetworks',
|
|
73
|
+
useIPv6Defaults
|
|
74
|
+
? defaultNetworkSettings.clusterNetworksIpv6
|
|
75
|
+
: defaultNetworkSettings.clusterNetworksIpv4,
|
|
76
|
+
);
|
|
77
|
+
setFieldValue(
|
|
78
|
+
'serviceNetworks',
|
|
79
|
+
useIPv6Defaults
|
|
80
|
+
? defaultNetworkSettings.serviceNetworksIpv6
|
|
81
|
+
: defaultNetworkSettings.serviceNetworksIpv4,
|
|
82
|
+
);
|
|
68
83
|
}
|
|
69
84
|
},
|
|
70
|
-
[setFieldValue, defaultNetworkSettings],
|
|
85
|
+
[setFieldValue, defaultNetworkSettings, values.machineNetworks],
|
|
71
86
|
);
|
|
72
87
|
|
|
73
88
|
// Auto-enable advanced networking when switching to dual-stack
|
|
@@ -77,6 +92,37 @@ const NetworkConfiguration = ({
|
|
|
77
92
|
}
|
|
78
93
|
}, [isDualStack, toggleAdvConfiguration]);
|
|
79
94
|
|
|
95
|
+
// Sync cluster/service networks to match primary machine network family when single-stack (fix mismatch)
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (isDualStack) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const primaryCidr = values.machineNetworks?.[0]?.cidr;
|
|
101
|
+
const firstClusterCidr = values.clusterNetworks?.[0]?.cidr;
|
|
102
|
+
if (!primaryCidr || !firstClusterCidr) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const primaryIsIPv6 = isCIDR.v6(primaryCidr);
|
|
106
|
+
const primaryIsIPv4 = isCIDR.v4(primaryCidr);
|
|
107
|
+
const clusterIsIPv6 = isCIDR.v6(firstClusterCidr);
|
|
108
|
+
const clusterIsIPv4 = isCIDR.v4(firstClusterCidr);
|
|
109
|
+
|
|
110
|
+
if (primaryIsIPv4 && clusterIsIPv6) {
|
|
111
|
+
setFieldValue('clusterNetworks', defaultNetworkSettings.clusterNetworksIpv4);
|
|
112
|
+
setFieldValue('serviceNetworks', defaultNetworkSettings.serviceNetworksIpv4);
|
|
113
|
+
} else if (primaryIsIPv6 && clusterIsIPv4) {
|
|
114
|
+
setFieldValue('clusterNetworks', defaultNetworkSettings.clusterNetworksIpv6);
|
|
115
|
+
setFieldValue('serviceNetworks', defaultNetworkSettings.serviceNetworksIpv6);
|
|
116
|
+
}
|
|
117
|
+
}, [
|
|
118
|
+
isDualStack,
|
|
119
|
+
values.machineNetworks,
|
|
120
|
+
values.clusterNetworks,
|
|
121
|
+
values.serviceNetworks,
|
|
122
|
+
setFieldValue,
|
|
123
|
+
defaultNetworkSettings,
|
|
124
|
+
]);
|
|
125
|
+
|
|
80
126
|
const isUserManagedNetworking = values.managedNetworkingType === 'userManaged';
|
|
81
127
|
const primaryMachineNetwork = values.machineNetworks?.[0]?.cidr;
|
|
82
128
|
|
|
@@ -117,6 +163,7 @@ const NetworkConfiguration = ({
|
|
|
117
163
|
validateField,
|
|
118
164
|
primaryMachineNetwork,
|
|
119
165
|
]);
|
|
166
|
+
|
|
120
167
|
return (
|
|
121
168
|
<Grid hasGutter>
|
|
122
169
|
{!hideManagedNetworking && <ManagedNetworkingControlGroup />}
|
|
@@ -128,17 +175,18 @@ const NetworkConfiguration = ({
|
|
|
128
175
|
/>
|
|
129
176
|
)}
|
|
130
177
|
|
|
178
|
+
<NetworkTypeDropDown isSDNSelectable={isSDNSelectable} />
|
|
179
|
+
|
|
131
180
|
{(!isMultiNodeCluster || !isUserManagedNetworking) && (
|
|
132
181
|
<StackTypeControlGroup
|
|
133
182
|
clusterId={cluster.id}
|
|
134
183
|
isDualStackSelectable={isDualStackSelectable}
|
|
135
184
|
hostSubnets={hostSubnets}
|
|
136
185
|
defaultNetworkValues={defaultNetworkSettings}
|
|
186
|
+
allowSingleStackIPv6
|
|
137
187
|
/>
|
|
138
188
|
)}
|
|
139
189
|
|
|
140
|
-
<NetworkTypeControlGroup isSDNSelectable={isSDNSelectable} />
|
|
141
|
-
|
|
142
190
|
{!(isMultiNodeCluster && isUserManagedNetworking) && (
|
|
143
191
|
<AvailableSubnetsControl
|
|
144
192
|
clusterId={cluster.id}
|
|
@@ -148,6 +196,7 @@ const NetworkConfiguration = ({
|
|
|
148
196
|
openshiftVersion={cluster.openshiftVersion}
|
|
149
197
|
hosts={cluster.hosts || []}
|
|
150
198
|
isMultiNodeCluster={isMultiNodeCluster}
|
|
199
|
+
allowSingleStackIPv6
|
|
151
200
|
/>
|
|
152
201
|
)}
|
|
153
202
|
|
|
@@ -11,7 +11,12 @@ import {
|
|
|
11
11
|
GridItem,
|
|
12
12
|
} from '@patternfly/react-core';
|
|
13
13
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
ClusterWizardStepHeader,
|
|
16
|
+
CustomManifestsAlert,
|
|
17
|
+
isThirdPartyCNI,
|
|
18
|
+
useTranslation,
|
|
19
|
+
} from '../../../../common';
|
|
15
20
|
import { AgentClusterInstallK8sResource, AgentClusterInstallModel } from '../../../types';
|
|
16
21
|
import { ConfigMapForm, CustomManifestFormType } from './ConfigMapForm';
|
|
17
22
|
import { appendPatch } from '../../../utils';
|
|
@@ -31,6 +36,9 @@ export const ClusterDeploymentCustomManifestsStep = ({
|
|
|
31
36
|
})) || [],
|
|
32
37
|
};
|
|
33
38
|
|
|
39
|
+
const usesExternalPlatform = agentClusterInstall.spec?.platformType === 'External';
|
|
40
|
+
const usesThirdPartyCNI = isThirdPartyCNI(agentClusterInstall.spec?.networking.networkType);
|
|
41
|
+
|
|
34
42
|
const validationSchema = Yup.lazy((values: CustomManifestFormType) =>
|
|
35
43
|
Yup.object<CustomManifestFormType>({
|
|
36
44
|
configMaps: Yup.array()
|
|
@@ -54,7 +62,7 @@ export const ClusterDeploymentCustomManifestsStep = ({
|
|
|
54
62
|
}),
|
|
55
63
|
)
|
|
56
64
|
.min(
|
|
57
|
-
|
|
65
|
+
usesExternalPlatform || usesThirdPartyCNI ? 1 : 0,
|
|
58
66
|
t('ai:At least one config map is required'),
|
|
59
67
|
),
|
|
60
68
|
}),
|
|
@@ -114,6 +122,14 @@ export const ClusterDeploymentCustomManifestsStep = ({
|
|
|
114
122
|
</Content>
|
|
115
123
|
</Alert>
|
|
116
124
|
</GridItem>
|
|
125
|
+
{(usesExternalPlatform || usesThirdPartyCNI) && (
|
|
126
|
+
<GridItem>
|
|
127
|
+
<CustomManifestsAlert
|
|
128
|
+
usesExternalPlatform={usesExternalPlatform}
|
|
129
|
+
usesThirdPartyCNI={usesThirdPartyCNI}
|
|
130
|
+
/>
|
|
131
|
+
</GridItem>
|
|
132
|
+
)}
|
|
117
133
|
<GridItem>
|
|
118
134
|
<Formik
|
|
119
135
|
initialValues={initialValues}
|
|
@@ -1,36 +1,50 @@
|
|
|
1
|
+
import isCIDR from 'is-cidr';
|
|
1
2
|
import {
|
|
2
3
|
Cluster,
|
|
3
4
|
ClusterDefaultConfig,
|
|
4
5
|
} from '@openshift-assisted/types/assisted-installer-service';
|
|
5
6
|
import { NetworkConfigurationValues } from '../../../common/types/clusters';
|
|
6
7
|
import { isDualStack } from '../../../common/components/clusterConfiguration/utils';
|
|
7
|
-
import { DUAL_STACK,
|
|
8
|
+
import { DUAL_STACK, NETWORK_TYPE_OVN, SINGLE_STACK } from '../../../common';
|
|
8
9
|
|
|
9
10
|
export const getNetworkInitialValues = (
|
|
10
11
|
cluster: Cluster,
|
|
11
12
|
defaultNetworkSettings: Pick<
|
|
12
13
|
ClusterDefaultConfig,
|
|
13
14
|
| 'clusterNetworksIpv4'
|
|
15
|
+
| 'clusterNetworksIpv6'
|
|
14
16
|
| 'clusterNetworksDualstack'
|
|
15
17
|
| 'serviceNetworksIpv4'
|
|
18
|
+
| 'serviceNetworksIpv6'
|
|
16
19
|
| 'serviceNetworksDualstack'
|
|
17
20
|
>,
|
|
18
21
|
): NetworkConfigurationValues => {
|
|
19
22
|
const managedNetworkingType = cluster.userManagedNetworking ? 'userManaged' : 'clusterManaged';
|
|
20
23
|
const isDualStackCluster = isDualStack(cluster);
|
|
24
|
+
const primaryMachineCidr = cluster.machineNetworks?.[0]?.cidr;
|
|
25
|
+
const isSingleStackIPv6 =
|
|
26
|
+
!isDualStackCluster && primaryMachineCidr && isCIDR.v6(primaryMachineCidr);
|
|
21
27
|
|
|
22
28
|
let clusterNetworks = cluster.clusterNetworks;
|
|
23
29
|
if (!cluster.clusterNetworks?.length) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
if (isDualStackCluster) {
|
|
31
|
+
clusterNetworks = defaultNetworkSettings.clusterNetworksDualstack;
|
|
32
|
+
} else if (isSingleStackIPv6) {
|
|
33
|
+
clusterNetworks = defaultNetworkSettings.clusterNetworksIpv6;
|
|
34
|
+
} else {
|
|
35
|
+
clusterNetworks = defaultNetworkSettings.clusterNetworksIpv4;
|
|
36
|
+
}
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
let serviceNetworks = cluster.serviceNetworks;
|
|
30
40
|
if (!serviceNetworks?.length) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
if (isDualStackCluster) {
|
|
42
|
+
serviceNetworks = defaultNetworkSettings.serviceNetworksDualstack;
|
|
43
|
+
} else if (isSingleStackIPv6) {
|
|
44
|
+
serviceNetworks = defaultNetworkSettings.serviceNetworksIpv6;
|
|
45
|
+
} else {
|
|
46
|
+
serviceNetworks = defaultNetworkSettings.serviceNetworksIpv4;
|
|
47
|
+
}
|
|
34
48
|
}
|
|
35
49
|
|
|
36
50
|
const machineNetworks = cluster.machineNetworks || [];
|
|
@@ -45,6 +59,6 @@ export const getNetworkInitialValues = (
|
|
|
45
59
|
vipDhcpAllocation: cluster.vipDhcpAllocation,
|
|
46
60
|
managedNetworkingType,
|
|
47
61
|
networkType: cluster.networkType || NETWORK_TYPE_OVN,
|
|
48
|
-
stackType: isDualStackCluster ? DUAL_STACK :
|
|
62
|
+
stackType: isDualStackCluster ? DUAL_STACK : SINGLE_STACK,
|
|
49
63
|
};
|
|
50
64
|
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useField, useFormikContext } from 'formik';
|
|
3
|
+
import {
|
|
4
|
+
Dropdown,
|
|
5
|
+
DropdownItem,
|
|
6
|
+
FormGroup,
|
|
7
|
+
MenuToggle,
|
|
8
|
+
MenuToggleElement,
|
|
9
|
+
Stack,
|
|
10
|
+
StackItem,
|
|
11
|
+
} from '@patternfly/react-core';
|
|
12
|
+
import { getFieldId } from '../../../../common/components/ui';
|
|
13
|
+
import type { NetworkConfigurationValues } from '../../../../common/types/clusters';
|
|
14
|
+
import {
|
|
15
|
+
NETWORK_TYPE_LABELS,
|
|
16
|
+
NETWORK_TYPE_SDN,
|
|
17
|
+
isThirdPartyCNI,
|
|
18
|
+
} from '../../../../common/types/networkType';
|
|
19
|
+
import { useTranslation } from '../../../../common/hooks';
|
|
20
|
+
import { ThirdPartyCNIBanner } from '../../../../common';
|
|
21
|
+
|
|
22
|
+
export const NetworkTypeDropDown = ({ isSDNSelectable }: { isSDNSelectable: boolean }) => {
|
|
23
|
+
const { t } = useTranslation();
|
|
24
|
+
const [field, , { setValue }] = useField<string>('networkType');
|
|
25
|
+
const [isOpen, setOpen] = React.useState(false);
|
|
26
|
+
const { values } = useFormikContext<NetworkConfigurationValues>();
|
|
27
|
+
const fieldId = getFieldId('networkType', 'input');
|
|
28
|
+
|
|
29
|
+
const showThirdPartyBanner = isThirdPartyCNI(values.networkType);
|
|
30
|
+
|
|
31
|
+
const currentDisplayValue = NETWORK_TYPE_LABELS(t)[field.value];
|
|
32
|
+
const dropdownItems = Object.entries(NETWORK_TYPE_LABELS(t)).map(([value, label]) => (
|
|
33
|
+
<DropdownItem
|
|
34
|
+
key={value}
|
|
35
|
+
id={value}
|
|
36
|
+
value={value}
|
|
37
|
+
isAriaDisabled={value === NETWORK_TYPE_SDN && !isSDNSelectable}
|
|
38
|
+
>
|
|
39
|
+
{label}
|
|
40
|
+
</DropdownItem>
|
|
41
|
+
));
|
|
42
|
+
|
|
43
|
+
const onSelect = (_event?: React.MouseEvent<Element, MouseEvent>, nextValue?: string): void => {
|
|
44
|
+
if (nextValue) {
|
|
45
|
+
setValue(nextValue);
|
|
46
|
+
}
|
|
47
|
+
setOpen(false);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
|
|
51
|
+
<MenuToggle
|
|
52
|
+
ref={toggleRef}
|
|
53
|
+
onClick={() => setOpen(!isOpen)}
|
|
54
|
+
isExpanded={isOpen}
|
|
55
|
+
id={fieldId}
|
|
56
|
+
className="pf-v6-u-w-100"
|
|
57
|
+
style={{ minWidth: '100%' }}
|
|
58
|
+
>
|
|
59
|
+
{currentDisplayValue || t('ai:Network type')}
|
|
60
|
+
</MenuToggle>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Stack hasGutter>
|
|
65
|
+
<StackItem>
|
|
66
|
+
<FormGroup fieldId={fieldId} label={t('ai:Network type')} id={`form-control__${fieldId}`}>
|
|
67
|
+
<Dropdown
|
|
68
|
+
id={`${fieldId}-dropdown`}
|
|
69
|
+
onOpenChange={(open: boolean) => setOpen(open)}
|
|
70
|
+
onSelect={onSelect}
|
|
71
|
+
toggle={toggle}
|
|
72
|
+
isOpen={isOpen}
|
|
73
|
+
>
|
|
74
|
+
{dropdownItems}
|
|
75
|
+
</Dropdown>
|
|
76
|
+
</FormGroup>
|
|
77
|
+
</StackItem>
|
|
78
|
+
{showThirdPartyBanner && <ThirdPartyCNIBanner />}
|
|
79
|
+
</Stack>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -20,12 +20,8 @@ import {
|
|
|
20
20
|
httpProxyValidationSchema,
|
|
21
21
|
noProxyValidationSchema,
|
|
22
22
|
CLUSTER_DEFAULT_NETWORK_SETTINGS,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
dualStackValidationSchema,
|
|
26
|
-
IPv4ValidationSchema,
|
|
27
|
-
IPV4_STACK,
|
|
28
|
-
NetworkConfigurationValues,
|
|
23
|
+
clusterNetworksSchema,
|
|
24
|
+
serviceNetworksSchema,
|
|
29
25
|
} from '../../../common';
|
|
30
26
|
import { ClusterDeploymentNetworkingValues } from './types';
|
|
31
27
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
@@ -53,22 +49,18 @@ const getNetworkConfigurationValidationSchema = (
|
|
|
53
49
|
) =>
|
|
54
50
|
Yup.lazy((values: ClusterDeploymentNetworkingValues) =>
|
|
55
51
|
Yup.object<ClusterDeploymentNetworkingValues>().shape({
|
|
56
|
-
clusterNetworks:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
serviceNetworkValidationSchema(t).concat(
|
|
69
|
-
dualStackValidationSchema(t('ai:service network'), t, openshiftVersion),
|
|
70
|
-
),
|
|
71
|
-
}),
|
|
52
|
+
clusterNetworks: clusterNetworksSchema(
|
|
53
|
+
t,
|
|
54
|
+
values.stackType ?? '',
|
|
55
|
+
values.machineNetworks?.[0]?.cidr,
|
|
56
|
+
openshiftVersion,
|
|
57
|
+
),
|
|
58
|
+
serviceNetworks: serviceNetworksSchema(
|
|
59
|
+
t,
|
|
60
|
+
values.stackType ?? '',
|
|
61
|
+
values.machineNetworks?.[0]?.cidr,
|
|
62
|
+
openshiftVersion,
|
|
63
|
+
),
|
|
72
64
|
apiVips: vipArrayValidationSchema(hostSubnets, values, t),
|
|
73
65
|
ingressVips: vipArrayValidationSchema(hostSubnets, values, t),
|
|
74
66
|
sshPublicKey: sshPublicKeyListValidationSchema(t),
|
|
@@ -13,7 +13,7 @@ import { useFormikContext } from 'formik';
|
|
|
13
13
|
import { InputField } from '../../../../common';
|
|
14
14
|
import { useTranslation } from '../../../../common/hooks/use-translation-wrapper';
|
|
15
15
|
import { AgentK8sResource } from '../../../types';
|
|
16
|
-
import { getAgentsForSelection,
|
|
16
|
+
import { getAgentsForSelection, getVersionFromReleaseString } from '../../helpers';
|
|
17
17
|
import NodePoolAgentsForm from '../forms/NodePoolAgentsForm';
|
|
18
18
|
import {
|
|
19
19
|
AgentMachineK8sResource,
|
|
@@ -44,7 +44,7 @@ const NodePoolForm = ({ agents, nodePool, hostedCluster, agentMachines }: NodePo
|
|
|
44
44
|
!agent.spec.clusterDeploymentName,
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
-
const ocpVersion =
|
|
47
|
+
const ocpVersion = getVersionFromReleaseString(hostedCluster.spec.release.image);
|
|
48
48
|
|
|
49
49
|
if (isEdit) {
|
|
50
50
|
const nodePoolAgents = getNodepoolAgents(nodePool, agents, agentMachines, hostedCluster);
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { ClusterImageSetK8sResource } from '../../types';
|
|
10
10
|
import { featureSupportLevelsACM } from '../../config/constants';
|
|
11
11
|
import { getFeatureDisabledReason, isFeatureSupported } from './featureStateUtils';
|
|
12
|
-
import { getOCPVersions,
|
|
12
|
+
import { getOCPVersions, getVersionFromClusterImageSet } from '../helpers';
|
|
13
13
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
14
14
|
import { SupportLevel } from '@openshift-assisted/types/assisted-installer-service';
|
|
15
15
|
import { getMajorMinorVersion } from '../../../common/utils';
|
|
@@ -53,10 +53,7 @@ export const ACMFeatureSupportLevelProvider: React.FC<ACMFeatureSupportLevelProv
|
|
|
53
53
|
const clusterImage = clusterImages.find(
|
|
54
54
|
(clusterImageSet) => clusterImageSet.metadata?.name === versionName,
|
|
55
55
|
);
|
|
56
|
-
const version =
|
|
57
|
-
getVersionFromReleaseImage(clusterImage?.spec?.releaseImage) ||
|
|
58
|
-
clusterImage?.metadata?.name ||
|
|
59
|
-
'';
|
|
56
|
+
const version = getVersionFromClusterImageSet(clusterImage);
|
|
60
57
|
return getMajorMinorVersion(version);
|
|
61
58
|
},
|
|
62
59
|
[clusterImages],
|