@openshift-assisted/ui-lib 2.18.0-cim → 2.18.2-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.
Files changed (138) hide show
  1. package/build/@types/cim/components/ClusterDeployment/NetworkConfiguration.d.ts +1 -1
  2. package/build/@types/cim/components/ClusterDeployment/NetworkConfiguration.d.ts.map +1 -1
  3. package/build/@types/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.d.ts.map +1 -1
  4. package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts +1 -1
  5. package/build/@types/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts.map +1 -1
  6. package/build/@types/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.d.ts +5 -0
  7. package/build/@types/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.d.ts.map +1 -0
  8. package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts +4 -4
  9. package/build/@types/cim/components/ClusterDeployment/use-networking-formik.d.ts.map +1 -1
  10. package/build/@types/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.d.ts.map +1 -1
  11. package/build/@types/cim/components/helpers/versions.d.ts +2 -2
  12. package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
  13. package/build/@types/cim/components/helpers/versions.test.d.ts +2 -0
  14. package/build/@types/cim/components/helpers/versions.test.d.ts.map +1 -0
  15. package/build/@types/cim/components/modals/CimConfiguration/CimConfigurationModal.d.ts.map +1 -1
  16. package/build/@types/cim/components/modals/CimConfiguration/persist.d.ts +14 -17
  17. package/build/@types/cim/components/modals/CimConfiguration/persist.d.ts.map +1 -1
  18. package/build/@types/cim/types/k8s/agent-cluster-install.d.ts +1 -1
  19. package/build/@types/cim/types/k8s/agent-cluster-install.d.ts.map +1 -1
  20. package/build/@types/common/components/clusterWizard/customManifests/CustomManifestsAlert.d.ts +6 -0
  21. package/build/@types/common/components/clusterWizard/customManifests/CustomManifestsAlert.d.ts.map +1 -0
  22. package/build/@types/common/components/clusterWizard/customManifests/index.d.ts +2 -0
  23. package/build/@types/common/components/clusterWizard/customManifests/index.d.ts.map +1 -0
  24. package/build/@types/common/components/clusterWizard/index.d.ts +2 -0
  25. package/build/@types/common/components/clusterWizard/index.d.ts.map +1 -1
  26. package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts +2 -1
  27. package/build/@types/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts.map +1 -1
  28. package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts +2 -1
  29. package/build/@types/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.d.ts.map +1 -1
  30. package/build/@types/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.d.ts +3 -0
  31. package/build/@types/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.d.ts.map +1 -0
  32. package/build/@types/common/components/clusterWizard/networkingSteps/index.d.ts +1 -0
  33. package/build/@types/common/components/clusterWizard/networkingSteps/index.d.ts.map +1 -1
  34. package/build/@types/common/components/ui/formik/utils.d.ts +1 -0
  35. package/build/@types/common/components/ui/formik/utils.d.ts.map +1 -1
  36. package/build/@types/common/config/constants.d.ts +2 -2
  37. package/build/@types/common/config/constants.d.ts.map +1 -1
  38. package/build/@types/common/types/networkType.d.ts +2 -1
  39. package/build/@types/common/types/networkType.d.ts.map +1 -1
  40. package/build/@types/common/validationSchemas/networkingValidation.d.ts +10 -0
  41. package/build/@types/common/validationSchemas/networkingValidation.d.ts.map +1 -1
  42. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.d.ts.map +1 -1
  43. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts.map +1 -1
  44. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts.map +1 -1
  45. package/build/@types/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.d.ts.map +1 -1
  46. package/build/@types/ocm/components/clusterDetail/ClusterProperties.d.ts +2 -1
  47. package/build/@types/ocm/components/clusterDetail/ClusterProperties.d.ts.map +1 -1
  48. package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js +46 -7
  49. package/build/cjs/cim/components/ClusterDeployment/NetworkConfiguration.js.map +1 -1
  50. package/build/cjs/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.js +24 -23
  51. package/build/cjs/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.js.map +1 -1
  52. package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +25 -9
  53. package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.map +1 -1
  54. package/build/cjs/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.js +35 -0
  55. package/build/cjs/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.js.map +1 -0
  56. package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js +13 -18
  57. package/build/cjs/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
  58. package/build/cjs/cim/components/Hypershift/modals/NodePoolForm.js +1 -1
  59. package/build/cjs/cim/components/Hypershift/modals/NodePoolForm.js.map +1 -1
  60. package/build/cjs/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.js +1 -4
  61. package/build/cjs/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.js.map +1 -1
  62. package/build/cjs/cim/components/helpers/versions.js +39 -28
  63. package/build/cjs/cim/components/helpers/versions.js.map +1 -1
  64. package/build/cjs/cim/components/helpers/versions.test.js +423 -0
  65. package/build/cjs/cim/components/helpers/versions.test.js.map +1 -0
  66. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js +39 -16
  67. package/build/cjs/cim/components/modals/CimConfiguration/CimConfigurationModal.js.map +1 -1
  68. package/build/cjs/cim/components/modals/CimConfiguration/persist.js +95 -135
  69. package/build/cjs/cim/components/modals/CimConfiguration/persist.js.map +1 -1
  70. package/build/cjs/common/components/clusterWizard/customManifests/CustomManifestsAlert.js +32 -0
  71. package/build/cjs/common/components/clusterWizard/customManifests/CustomManifestsAlert.js.map +1 -0
  72. package/build/cjs/common/components/clusterWizard/customManifests/index.js +5 -0
  73. package/build/cjs/common/components/clusterWizard/customManifests/index.js.map +1 -0
  74. package/build/cjs/common/components/clusterWizard/index.js +2 -0
  75. package/build/cjs/common/components/clusterWizard/index.js.map +1 -1
  76. package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js +8 -2
  77. package/build/cjs/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.js.map +1 -1
  78. package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js +29 -19
  79. package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js.map +1 -1
  80. package/build/cjs/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.js +20 -0
  81. package/build/cjs/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.js.map +1 -0
  82. package/build/cjs/common/components/clusterWizard/networkingSteps/index.js +3 -4
  83. package/build/cjs/common/components/clusterWizard/networkingSteps/index.js.map +1 -1
  84. package/build/cjs/common/components/ui/formik/utils.js +5 -1
  85. package/build/cjs/common/components/ui/formik/utils.js.map +1 -1
  86. package/build/cjs/common/config/constants.js +9 -2
  87. package/build/cjs/common/config/constants.js.map +1 -1
  88. package/build/cjs/common/types/networkType.js +9 -8
  89. package/build/cjs/common/types/networkType.js.map +1 -1
  90. package/build/cjs/common/validationSchemas/networkingValidation.js +19 -1
  91. package/build/cjs/common/validationSchemas/networkingValidation.js.map +1 -1
  92. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js +1 -20
  93. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js.map +1 -1
  94. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +1 -1
  95. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
  96. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js +6 -9
  97. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js.map +1 -1
  98. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js +4 -4
  99. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js.map +1 -1
  100. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js +3 -2
  101. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js.map +1 -1
  102. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js +3 -3
  103. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js.map +1 -1
  104. package/lib/cim/components/ClusterDeployment/NetworkConfiguration.tsx +55 -6
  105. package/lib/cim/components/ClusterDeployment/customManifests/ClusterDeploymentCustomManifestsStep.tsx +18 -2
  106. package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +22 -8
  107. package/lib/cim/components/ClusterDeployment/networking/NetworkTypeDropdown.tsx +81 -0
  108. package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +14 -22
  109. package/lib/cim/components/Hypershift/modals/NodePoolForm.tsx +2 -2
  110. package/lib/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.tsx +2 -5
  111. package/lib/cim/components/helpers/versions.test.ts +465 -0
  112. package/lib/cim/components/helpers/versions.ts +37 -31
  113. package/lib/cim/components/modals/CimConfiguration/CimConfigurationModal.tsx +45 -18
  114. package/lib/cim/components/modals/CimConfiguration/persist.ts +97 -199
  115. package/lib/cim/types/k8s/agent-cluster-install.ts +1 -1
  116. package/lib/common/components/clusterWizard/customManifests/CustomManifestsAlert.tsx +39 -0
  117. package/lib/common/components/clusterWizard/customManifests/index.tsx +1 -0
  118. package/lib/common/components/clusterWizard/index.ts +2 -0
  119. package/lib/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.tsx +8 -1
  120. package/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx +36 -26
  121. package/lib/common/components/clusterWizard/networkingSteps/ThirdPartyCNIBanner.tsx +28 -0
  122. package/lib/common/components/clusterWizard/networkingSteps/index.ts +1 -0
  123. package/lib/common/components/ui/formik/utils.ts +6 -0
  124. package/lib/common/config/constants.ts +10 -1
  125. package/lib/common/types/networkType.ts +9 -8
  126. package/lib/common/validationSchemas/networkingValidation.tsx +39 -1
  127. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.tsx +10 -45
  128. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +2 -2
  129. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx +7 -24
  130. package/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts +6 -5
  131. package/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx +9 -3
  132. package/lib/ocm/components/clusterDetail/ClusterProperties.tsx +7 -3
  133. package/package.json +3 -3
  134. package/build/@types/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.d.ts +0 -7
  135. package/build/@types/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.d.ts.map +0 -1
  136. package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js +0 -33
  137. package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +0 -1
  138. package/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx +0 -74
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { useTranslation } from '../../../hooks';
3
+ import { Alert, AlertVariant, Stack, StackItem } from '@patternfly/react-core';
4
+ import { RED_HAT_CNI_SUPPORT_MATRIX_LINK } from '../../../config';
5
+ import { ExternalLink } from '../../ui';
6
+
7
+ export const ThirdPartyCNIBanner = () => {
8
+ const { t } = useTranslation();
9
+
10
+ return (
11
+ <StackItem>
12
+ <Alert variant={AlertVariant.warning} isInline title={t('ai:Third-party CNI')}>
13
+ <Stack hasGutter>
14
+ <StackItem>
15
+ {t(
16
+ 'ai:Third-party CNIs require uploading CNI manifests. Please verify you have the required manifests and that the chosen CNI is compatible with your platform and OpenShift version.',
17
+ )}
18
+ </StackItem>
19
+ <StackItem>
20
+ <ExternalLink href={RED_HAT_CNI_SUPPORT_MATRIX_LINK}>
21
+ {t('ai:Red Hat CNI Support Matrix')}
22
+ </ExternalLink>
23
+ </StackItem>
24
+ </Stack>
25
+ </Alert>
26
+ </StackItem>
27
+ );
28
+ };
@@ -14,3 +14,4 @@ export { VirtualIPControlGroup } from './VirtualIPControlGroup';
14
14
  export type { VirtualIPControlGroupProps } from './VirtualIPControlGroup';
15
15
  export { default as AdvancedNetworkFields } from './AdvancedNetworkFields';
16
16
  export type { AdvancedNetworkFieldsProps } from './AdvancedNetworkFields';
17
+ export * from './ThirdPartyCNIBanner';
@@ -126,6 +126,12 @@ export const allSubnetsIPv4 = (
126
126
  return !!networks?.every((network) => network.cidr && Address4.isValid(network.cidr));
127
127
  };
128
128
 
129
+ export const allSubnetsIPv6 = (
130
+ networks: (MachineNetwork | ClusterNetwork | ServiceNetwork)[] | undefined,
131
+ ) => {
132
+ return !!networks?.every((network) => network.cidr && Address6.isValid(network.cidr));
133
+ };
134
+
129
135
  export const labelsToArray = (labels: { [key in string]: string } = {}): string[] => {
130
136
  const result: string[] = [];
131
137
  for (const key in labels) {
@@ -289,8 +289,10 @@ export const CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6 = {
289
289
  export const CLUSTER_DEFAULT_NETWORK_SETTINGS: Pick<
290
290
  ClusterDefaultConfig,
291
291
  | 'clusterNetworksIpv4'
292
+ | 'clusterNetworksIpv6'
292
293
  | 'clusterNetworksDualstack'
293
294
  | 'serviceNetworksIpv4'
295
+ | 'serviceNetworksIpv6'
294
296
  | 'serviceNetworksDualstack'
295
297
  > = {
296
298
  clusterNetworksIpv4: [
@@ -299,6 +301,12 @@ export const CLUSTER_DEFAULT_NETWORK_SETTINGS: Pick<
299
301
  hostPrefix: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.clusterNetworkHostPrefix,
300
302
  },
301
303
  ],
304
+ clusterNetworksIpv6: [
305
+ {
306
+ cidr: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.clusterNetworkCidr,
307
+ hostPrefix: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.clusterNetworkHostPrefix,
308
+ },
309
+ ],
302
310
  clusterNetworksDualstack: [
303
311
  {
304
312
  cidr: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.clusterNetworkCidr,
@@ -310,6 +318,7 @@ export const CLUSTER_DEFAULT_NETWORK_SETTINGS: Pick<
310
318
  },
311
319
  ],
312
320
  serviceNetworksIpv4: [{ cidr: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.serviceNetworkCidr }],
321
+ serviceNetworksIpv6: [{ cidr: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.serviceNetworkCidr }],
313
322
  serviceNetworksDualstack: [
314
323
  { cidr: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4.serviceNetworkCidr },
315
324
  { cidr: CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6.serviceNetworkCidr },
@@ -333,7 +342,7 @@ export const MS_PER_DAY = 1000 * 60 * 60 * 24;
333
342
 
334
343
  export const NO_SUBNET_SET = 'NO_SUBNET_SET';
335
344
 
336
- export const IPV4_STACK = 'singleStack';
345
+ export const SINGLE_STACK = 'singleStack';
337
346
  export const DUAL_STACK = 'dualStack';
338
347
 
339
348
  export const PREFIX_MAX_RESTRICTION = {
@@ -1,4 +1,5 @@
1
1
  import type { FeatureSupportLevelId } from '@openshift-assisted/types/assisted-installer-service';
2
+ import { TFunction } from 'i18next';
2
3
 
3
4
  export type NetworkTypeKey =
4
5
  | 'OVNKubernetes'
@@ -15,14 +16,14 @@ export const NETWORK_TYPE_CILIUM: NetworkTypeKey = 'Cilium';
15
16
  export const NETWORK_TYPE_CALICO: NetworkTypeKey = 'Calico';
16
17
  export const NETWORK_TYPE_NONE: NetworkTypeKey = 'None';
17
18
 
18
- export const NETWORK_TYPE_LABELS: Record<string, string> = {
19
- [NETWORK_TYPE_OVN]: 'Open Virtual Networking (OVN)',
20
- [NETWORK_TYPE_SDN]: 'Software-Defined Networking (SDN)',
21
- [NETWORK_TYPE_CISCO_ACI]: 'Cisco ACI',
22
- [NETWORK_TYPE_CILIUM]: 'Isovalent Cilium',
23
- [NETWORK_TYPE_CALICO]: 'Tigera Calico',
24
- [NETWORK_TYPE_NONE]: 'None (Custom CNI)',
25
- };
19
+ export const NETWORK_TYPE_LABELS = (t: TFunction): Record<string, string> => ({
20
+ [NETWORK_TYPE_OVN]: t('ai:Open Virtual Networking (OVN)'),
21
+ [NETWORK_TYPE_SDN]: t('ai:Software-Defined Networking (SDN)'),
22
+ [NETWORK_TYPE_CISCO_ACI]: t('ai:Cisco ACI'),
23
+ [NETWORK_TYPE_CILIUM]: t('ai:Isovalent Cilium'),
24
+ [NETWORK_TYPE_CALICO]: t('ai:Tigera Calico'),
25
+ [NETWORK_TYPE_NONE]: t('ai:None (Custom CNI)'),
26
+ });
26
27
 
27
28
  export const NETWORK_TYPE_FEATURE_IDS: Record<string, FeatureSupportLevelId> = {
28
29
  [NETWORK_TYPE_OVN]: 'OVN_NETWORK_TYPE',
@@ -13,7 +13,8 @@ import {
13
13
  ipBlockValidationSchema,
14
14
  } from './addressValidation';
15
15
  import { isMajorMinorVersionEqualOrGreater } from '../utils';
16
- import { allSubnetsIPv4 } from '../components/ui/formik/utils';
16
+ import { allSubnetsIPv4, allSubnetsIPv6 } from '../components/ui/formik/utils';
17
+ import { SINGLE_STACK } from '../config';
17
18
 
18
19
  export const machineNetworksValidationSchema = Yup.array().of(
19
20
  Yup.object({ cidr: hostSubnetValidationSchema, clusterId: Yup.string() }),
@@ -111,3 +112,40 @@ export const IPv4ValidationSchema = Yup.array().test(
111
112
  `All network subnets must be IPv4.`,
112
113
  (values?: (MachineNetwork | ClusterNetwork | ServiceNetwork)[]) => allSubnetsIPv4(values),
113
114
  );
115
+
116
+ export const IPv6ValidationSchema = Yup.array().test(
117
+ 'single-stack-ipv6',
118
+ 'All network subnets must be IPv6.',
119
+ (values?: (MachineNetwork | ClusterNetwork | ServiceNetwork)[]) => allSubnetsIPv6(values),
120
+ );
121
+
122
+ export const clusterNetworksSchema = (
123
+ t: TFunction,
124
+ stackType: string,
125
+ primaryCidr: string | undefined,
126
+ openshiftVersion?: string,
127
+ ) => {
128
+ const singleStackFamilySchema =
129
+ primaryCidr && isCIDR.v6(primaryCidr) ? IPv6ValidationSchema : IPv4ValidationSchema;
130
+
131
+ const stackFamilySchema =
132
+ stackType === SINGLE_STACK
133
+ ? singleStackFamilySchema
134
+ : dualStackValidationSchema(t('ai:cluster network'), t, openshiftVersion);
135
+ return clusterNetworksValidationSchema(t).concat(stackFamilySchema);
136
+ };
137
+
138
+ export const serviceNetworksSchema = (
139
+ t: TFunction,
140
+ stackType: string,
141
+ primaryCidr: string | undefined,
142
+ openshiftVersion?: string,
143
+ ) => {
144
+ const singleStackFamilySchema =
145
+ primaryCidr && isCIDR.v6(primaryCidr) ? IPv6ValidationSchema : IPv4ValidationSchema;
146
+ const stackFamilySchema =
147
+ stackType === SINGLE_STACK
148
+ ? singleStackFamilySchema
149
+ : dualStackValidationSchema(t('ai:service network'), t, openshiftVersion);
150
+ return serviceNetworkValidationSchema(t).concat(stackFamilySchema);
151
+ };
@@ -3,19 +3,21 @@ import {
3
3
  Content,
4
4
  ContentVariants,
5
5
  Alert,
6
- AlertVariant,
7
6
  Grid,
8
7
  FormGroup,
9
8
  Switch,
10
9
  Tooltip,
11
- Stack,
12
- StackItem,
13
10
  } from '@patternfly/react-core';
14
11
 
15
12
  import { CustomManifests } from './components/CustomManifests';
16
13
  import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
17
14
  import { CustomManifestFormState } from './components/propTypes';
18
- import { ClustersAPI, ClusterWizardStepHeader, isThirdPartyCNI } from '../../../../common';
15
+ import {
16
+ ClustersAPI,
17
+ ClusterWizardStepHeader,
18
+ CustomManifestsAlert,
19
+ isThirdPartyCNI,
20
+ } from '../../../../common';
19
21
  import { getFieldId } from '../../../../common/components/ui/formik';
20
22
  import { isOciPlatformType } from '../../utils';
21
23
  import DeleteCustomManifestModal from './DeleteCustomManifestModal';
@@ -90,46 +92,6 @@ export const CustomManifestsPage = ({
90
92
  ? 'Custom manifests are required when using a third-party CNI or Oracle Cloud Infrastructure.'
91
93
  : '';
92
94
 
93
- const showExternalPlatformReminder = isOciPlatformType(cluster);
94
- const showThirdPartyCnIReminder = isThirdPartyCNI(cluster.networkType);
95
- const showCombinedReminder = showExternalPlatformReminder && showThirdPartyCnIReminder;
96
- let reminderAlerts: React.ReactNode = null;
97
- if (showCombinedReminder) {
98
- reminderAlerts = (
99
- <Stack>
100
- <StackItem>
101
- <Alert
102
- variant={AlertVariant.info}
103
- isInline
104
- title="You're using an external platform and a third-party CNI"
105
- >
106
- Make sure to upload the required custom and CNI manifests in this step.
107
- </Alert>
108
- </StackItem>
109
- </Stack>
110
- );
111
- } else if (showExternalPlatformReminder) {
112
- reminderAlerts = (
113
- <Stack>
114
- <StackItem>
115
- <Alert variant={AlertVariant.info} isInline title="You're using an external platform">
116
- Make sure to upload the required custom manifests in this step.
117
- </Alert>
118
- </StackItem>
119
- </Stack>
120
- );
121
- } else if (showThirdPartyCnIReminder) {
122
- reminderAlerts = (
123
- <Stack>
124
- <StackItem>
125
- <Alert variant={AlertVariant.info} isInline title="You're using a third-party CNI">
126
- Make sure to upload the required CNI manifests in this step.
127
- </Alert>
128
- </StackItem>
129
- </Stack>
130
- );
131
- }
132
-
133
95
  return (
134
96
  <Grid hasGutter>
135
97
  <Content>
@@ -157,7 +119,10 @@ export const CustomManifestsPage = ({
157
119
  {!useCustomManifests && <div style={{ minHeight: '250px' }} aria-hidden="true" />}
158
120
  {useCustomManifests && (
159
121
  <>
160
- {reminderAlerts}
122
+ <CustomManifestsAlert
123
+ usesExternalPlatform={isOciPlatformType(cluster)}
124
+ usesThirdPartyCNI={isThirdPartyCNI(cluster.networkType)}
125
+ />
161
126
  <Alert
162
127
  isInline
163
128
  variant="warning"
@@ -9,7 +9,7 @@ import {
9
9
  getFormikErrorFields,
10
10
  getHostSubnets,
11
11
  HostSubnets,
12
- IPV4_STACK,
12
+ SINGLE_STACK,
13
13
  isSNO,
14
14
  LoadingState,
15
15
  NetworkConfigurationValues,
@@ -262,7 +262,7 @@ const NetworkConfigurationPage = ({ cluster }: { cluster: Cluster }) => {
262
262
  if (values.vipDhcpAllocation) {
263
263
  delete params.apiVips;
264
264
  delete params.ingressVips;
265
- } else if (values.stackType === IPV4_STACK) {
265
+ } else if (values.stackType === SINGLE_STACK) {
266
266
  // The API will rebuild the default machineNetwork
267
267
  params.machineNetworks = [];
268
268
  }
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useField, useFormikContext } from 'formik';
3
3
  import {
4
- Alert,
5
- AlertVariant,
6
4
  Dropdown,
7
5
  DropdownItem,
8
6
  FormGroup,
@@ -12,7 +10,7 @@ import {
12
10
  StackItem,
13
11
  Tooltip,
14
12
  } from '@patternfly/react-core';
15
- import { getFieldId, ExternalLink } from '../../../../common/components/ui';
13
+ import { getFieldId } from '../../../../common/components/ui';
16
14
  import {
17
15
  NewFeatureSupportLevelMap,
18
16
  useNewFeatureSupportLevel,
@@ -25,7 +23,8 @@ import {
25
23
  NETWORK_TYPE_FEATURE_IDS,
26
24
  isThirdPartyCNI,
27
25
  } from '../../../../common/types/networkType';
28
- import { RED_HAT_CNI_SUPPORT_MATRIX_LINK } from '../../../../common/config/docs_links';
26
+ import { useTranslation } from '../../../../common/hooks';
27
+ import { ThirdPartyCNIBanner } from '../../../../common';
29
28
 
30
29
  export interface NetworkTypeDropDownProps {
31
30
  isDisabled?: boolean;
@@ -36,6 +35,7 @@ export const NetworkTypeDropDown = ({
36
35
  isDisabled = false,
37
36
  featureSupportLevelData,
38
37
  }: NetworkTypeDropDownProps) => {
38
+ const { t } = useTranslation();
39
39
  const [field, , { setValue }] = useField<string>('networkType');
40
40
  const [isOpen, setOpen] = React.useState(false);
41
41
  const { values } = useFormikContext<NetworkConfigurationValues>();
@@ -54,9 +54,9 @@ export const NetworkTypeDropDown = ({
54
54
  }
55
55
  }, [field.value, setValue, featureSupportLevelData, getFeatureDisabledReason]);
56
56
 
57
- const currentDisplayValue = NETWORK_TYPE_LABELS[field.value];
57
+ const currentDisplayValue = NETWORK_TYPE_LABELS(t)[field.value];
58
58
 
59
- const dropdownItems = Object.entries(NETWORK_TYPE_LABELS).map(([value, label]) => {
59
+ const dropdownItems = Object.entries(NETWORK_TYPE_LABELS(t)).map(([value, label]) => {
60
60
  const disabledReason = getFeatureDisabledReason(
61
61
  NETWORK_TYPE_FEATURE_IDS[value],
62
62
  featureSupportLevelData ?? undefined,
@@ -119,24 +119,7 @@ export const NetworkTypeDropDown = ({
119
119
  </Dropdown>
120
120
  </FormGroup>
121
121
  </StackItem>
122
- {showThirdPartyBanner && (
123
- <StackItem>
124
- <Alert variant={AlertVariant.warning} isInline title="Third-party CNI">
125
- <Stack hasGutter>
126
- <StackItem>
127
- Third-party CNIs require uploading CNI manifests. Please verify you have the
128
- required manifests and that the chosen CNI is compatible with your platform and
129
- OpenShift version.
130
- </StackItem>
131
- <StackItem>
132
- <ExternalLink href={RED_HAT_CNI_SUPPORT_MATRIX_LINK}>
133
- Red Hat CNI Support Matrix
134
- </ExternalLink>
135
- </StackItem>
136
- </Stack>
137
- </Alert>
138
- </StackItem>
139
- )}
122
+ {showThirdPartyBanner && <ThirdPartyCNIBanner />}
140
123
  </Stack>
141
124
  );
142
125
  };
@@ -11,7 +11,7 @@ import {
11
11
  serviceNetworkValidationSchema,
12
12
  IPv4ValidationSchema,
13
13
  sshPublicKeyValidationSchema,
14
- IPV4_STACK,
14
+ SINGLE_STACK,
15
15
  DUAL_STACK,
16
16
  vipArrayValidationSchema,
17
17
  NETWORK_TYPE_OVN,
@@ -50,7 +50,7 @@ export const getNetworkInitialValues = (
50
50
  : 'clusterManaged',
51
51
  networkType: cluster.networkType || NETWORK_TYPE_OVN,
52
52
  machineNetworks: cluster.machineNetworks || [],
53
- stackType: isDualStackType ? DUAL_STACK : IPV4_STACK,
53
+ stackType: isDualStackType ? DUAL_STACK : SINGLE_STACK,
54
54
  clusterNetworks:
55
55
  cluster.clusterNetworks ||
56
56
  (isDualStackType
@@ -85,7 +85,8 @@ export const getNetworkConfigurationValidationSchema = (
85
85
  values.managedNetworkingType === 'userManaged'
86
86
  ? Yup.array()
87
87
  : machineNetworksValidationSchema.when('stackType', {
88
- is: (stackType: NetworkConfigurationValues['stackType']) => stackType === IPV4_STACK,
88
+ is: (stackType: NetworkConfigurationValues['stackType']) =>
89
+ stackType === SINGLE_STACK,
89
90
  then: () => machineNetworksValidationSchema.concat(IPv4ValidationSchema),
90
91
  otherwise: () =>
91
92
  values.machineNetworks && values.machineNetworks?.length >= 2
@@ -95,13 +96,13 @@ export const getNetworkConfigurationValidationSchema = (
95
96
  : Yup.array(),
96
97
  }),
97
98
  clusterNetworks: clusterNetworksValidationSchema(t).when('stackType', {
98
- is: (stackType: NetworkConfigurationValues['stackType']) => stackType === IPV4_STACK,
99
+ is: (stackType: NetworkConfigurationValues['stackType']) => stackType === SINGLE_STACK,
99
100
  then: (schema) => schema.concat(IPv4ValidationSchema),
100
101
  otherwise: (schema) =>
101
102
  schema.concat(dualStackValidationSchema('cluster network', t, openshiftVersion)),
102
103
  }),
103
104
  serviceNetworks: serviceNetworkValidationSchema(t).when('stackType', {
104
- is: (stackType: NetworkConfigurationValues['stackType']) => stackType === IPV4_STACK,
105
+ is: (stackType: NetworkConfigurationValues['stackType']) => stackType === SINGLE_STACK,
105
106
  then: (schema) => schema.concat(IPv4ValidationSchema),
106
107
  otherwise: (schema) =>
107
108
  schema.concat(dualStackValidationSchema('service network', t, openshiftVersion)),
@@ -1,7 +1,12 @@
1
1
  import { Title } from '@patternfly/react-core';
2
2
  import { Table, TableVariant, Tbody, Td, Tr } from '@patternfly/react-table';
3
3
  import React from 'react';
4
- import { genericTableRowKey, isDualStack, NETWORK_TYPE_LABELS } from '../../../../common';
4
+ import {
5
+ genericTableRowKey,
6
+ isDualStack,
7
+ NETWORK_TYPE_LABELS,
8
+ useTranslation,
9
+ } from '../../../../common';
5
10
  import { getManagementType, getStackTypeLabel } from '../../clusterDetail/ClusterProperties';
6
11
  import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
7
12
 
@@ -11,6 +16,7 @@ type ReviewTableRowsType = {
11
16
  }[];
12
17
 
13
18
  export const ReviewNetworkingTable = ({ cluster }: { cluster: Cluster }) => {
19
+ const { t } = useTranslation();
14
20
  const rows = React.useMemo(() => {
15
21
  const networkRows = [
16
22
  {
@@ -197,13 +203,13 @@ export const ReviewNetworkingTable = ({ cluster }: { cluster: Cluster }) => {
197
203
  cells: [
198
204
  { title: 'Networking type' },
199
205
  {
200
- title: cluster.networkType ? NETWORK_TYPE_LABELS[cluster.networkType] : '-',
206
+ title: cluster.networkType ? NETWORK_TYPE_LABELS(t)[cluster.networkType] : '-',
201
207
  props: { 'data-testid': 'networking-type', colSpan: 2 },
202
208
  },
203
209
  ],
204
210
  },
205
211
  ] as ReviewTableRowsType;
206
- }, [cluster]);
212
+ }, [cluster, t]);
207
213
 
208
214
  return (
209
215
  <>
@@ -18,14 +18,18 @@ import { ClusterFeatureSupportLevelsDetailItem } from '../featureSupportLevels';
18
18
  import OpenShiftVersionDetail from './OpenShiftVersionDetail';
19
19
  import { useNewFeatureSupportLevel } from '../../../common/components/newFeatureSupportLevels';
20
20
  import { Cluster, DiskEncryption } from '@openshift-assisted/types/assisted-installer-service';
21
+ import { TFunction } from 'i18next';
21
22
 
22
23
  type ClusterPropertiesProps = {
23
24
  cluster: Cluster;
24
25
  externalMode?: boolean;
25
26
  };
26
27
 
27
- export const getNetworkType = (clusterNetworkType: Cluster['networkType']): string => {
28
- return NETWORK_TYPE_LABELS[clusterNetworkType || ''];
28
+ export const getNetworkType = (
29
+ clusterNetworkType: Cluster['networkType'],
30
+ t: TFunction,
31
+ ): string => {
32
+ return NETWORK_TYPE_LABELS(t)[clusterNetworkType || ''];
29
33
  };
30
34
 
31
35
  export const getManagementType = ({ userManagedNetworking }: Cluster): string => {
@@ -111,7 +115,7 @@ const ClusterProperties = ({ cluster, externalMode = false }: ClusterPropertiesP
111
115
  />
112
116
  <DetailItem
113
117
  title="Networking Type"
114
- value={getNetworkType(cluster.networkType)}
118
+ value={getNetworkType(cluster.networkType, t)}
115
119
  testId="networking-type"
116
120
  />
117
121
  </DetailList>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@openshift-assisted/locales": "2.18.0-cim",
4
- "@openshift-assisted/types": "2.18.0-cim",
3
+ "@openshift-assisted/locales": "2.18.2-cim",
4
+ "@openshift-assisted/types": "2.18.2-cim",
5
5
  "@openshift-console/dynamic-plugin-sdk": "^4.19.1",
6
6
  "@patternfly/patternfly": "6.4.0",
7
7
  "@patternfly/react-code-editor": "6.4.1",
@@ -136,5 +136,5 @@
136
136
  ]
137
137
  }
138
138
  },
139
- "version": "2.18.0-cim"
139
+ "version": "2.18.2-cim"
140
140
  }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export interface NetworkTypeControlGroupProps {
3
- isDisabled?: boolean;
4
- isSDNSelectable: boolean;
5
- }
6
- export declare const NetworkTypeControlGroup: ({ isDisabled, isSDNSelectable, }: NetworkTypeControlGroupProps) => React.JSX.Element;
7
- //# sourceMappingURL=NetworkTypeControlGroup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NetworkTypeControlGroup.d.ts","sourceRoot":"","sources":["../../../../../../lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,uBAAuB,qCAGjC,4BAA4B,sBAwD9B,CAAC"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NetworkTypeControlGroup = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const react_core_1 = require("@patternfly/react-core");
7
- const formik_1 = require("../../ui/formik");
8
- const ui_1 = require("../../../components/ui");
9
- const networkType_1 = require("../../../types/networkType");
10
- const use_translation_wrapper_1 = require("../../../hooks/use-translation-wrapper");
11
- const GROUP_NAME = 'networkType';
12
- const NetworkTypeControlGroup = ({ isDisabled = false, isSDNSelectable, }) => {
13
- const { t } = (0, use_translation_wrapper_1.useTranslation)();
14
- return (react_1.default.createElement(react_core_1.FormGroup, { isInline: true, fieldId: GROUP_NAME, label: t('ai:Network type') },
15
- react_1.default.createElement(react_core_1.Split, null,
16
- react_1.default.createElement(react_core_1.SplitItem, null,
17
- react_1.default.createElement(react_core_1.Tooltip, { hidden: isSDNSelectable, content: t('ai:Network type selection is not supported for SNO clusters or when IPv6 is detected.') },
18
- react_1.default.createElement(formik_1.RadioField, { id: GROUP_NAME, name: GROUP_NAME, isDisabled: isDisabled || !isSDNSelectable, value: networkType_1.NETWORK_TYPE_OVN, label: react_1.default.createElement(react_1.default.Fragment, null,
19
- t('ai:Open Virtual Networking (OVN)'),
20
- "\u00A0") }))),
21
- react_1.default.createElement(react_core_1.SplitItem, null,
22
- react_1.default.createElement(ui_1.PopoverIcon, { bodyContent: t("ai:OVN separates the physical network topology from the logical one and is recommended if you're using new or telco features."), buttonStyle: { top: '-4px' } }))),
23
- react_1.default.createElement(react_core_1.Split, null,
24
- react_1.default.createElement(react_core_1.SplitItem, null,
25
- react_1.default.createElement(react_core_1.Tooltip, { hidden: isSDNSelectable, content: t('ai:Network type selection is not supported for SNO clusters or when IPv6 is detected.') },
26
- react_1.default.createElement(formik_1.RadioField, { id: GROUP_NAME, name: GROUP_NAME, isDisabled: isDisabled || !isSDNSelectable, value: networkType_1.NETWORK_TYPE_SDN, label: react_1.default.createElement(react_1.default.Fragment, null,
27
- t('ai:Software-Defined Networking (SDN)'),
28
- "\u00A0") }))),
29
- react_1.default.createElement(react_core_1.SplitItem, null,
30
- react_1.default.createElement(ui_1.PopoverIcon, { bodyContent: t('ai:The classic bullet-proof networking type'), buttonStyle: { top: '-4px' } })))));
31
- };
32
- exports.NetworkTypeControlGroup = NetworkTypeControlGroup;
33
- //# sourceMappingURL=NetworkTypeControlGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NetworkTypeControlGroup.js","sourceRoot":"","sources":["../../../../../../lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,uDAA8E;AAC9E,4CAA6C;AAC7C,+CAAqD;AACrD,4DAAgF;AAChF,oFAAwE;AAExE,MAAM,UAAU,GAAG,aAAa,CAAC;AAO1B,MAAM,uBAAuB,GAAG,CAAC,EACtC,UAAU,GAAG,KAAK,EAClB,eAAe,GACc,EAAE,EAAE;IACjC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,wCAAc,GAAE,CAAC;IAC/B,OAAO,CACL,8BAAC,sBAAS,IAAC,QAAQ,QAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,iBAAiB,CAAC;QAClE,8BAAC,kBAAK;YACJ,8BAAC,sBAAS;gBACR,8BAAC,oBAAO,IACN,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,CAAC,CACR,uFAAuF,CACxF;oBAED,8BAAC,mBAAU,IACT,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,IAAI,CAAC,eAAe,EAC1C,KAAK,EAAE,8BAAgB,EACvB,KAAK,EAAE;4BAAG,CAAC,CAAC,kCAAkC,CAAC;qCAAU,GACzD,CACM,CACA;YACZ,8BAAC,sBAAS;gBACR,8BAAC,gBAAW,IACV,WAAW,EAAE,CAAC,CACZ,+HAA+H,CAChI,EACD,WAAW,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAC5B,CACQ,CACN;QACR,8BAAC,kBAAK;YACJ,8BAAC,sBAAS;gBACR,8BAAC,oBAAO,IACN,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,CAAC,CACR,uFAAuF,CACxF;oBAED,8BAAC,mBAAU,IACT,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,IAAI,CAAC,eAAe,EAC1C,KAAK,EAAE,8BAAgB,EACvB,KAAK,EAAE;4BAAG,CAAC,CAAC,sCAAsC,CAAC;qCAAU,GAC7D,CACM,CACA;YACZ,8BAAC,sBAAS;gBACR,8BAAC,gBAAW,IACV,WAAW,EAAE,CAAC,CAAC,6CAA6C,CAAC,EAC7D,WAAW,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAC5B,CACQ,CACN,CACE,CACb,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,uBAAuB,2BA2DlC"}
@@ -1,74 +0,0 @@
1
- import React from 'react';
2
- import { Split, SplitItem, Tooltip, FormGroup } from '@patternfly/react-core';
3
- import { RadioField } from '../../ui/formik';
4
- import { PopoverIcon } from '../../../components/ui';
5
- import { NETWORK_TYPE_OVN, NETWORK_TYPE_SDN } from '../../../types/networkType';
6
- import { useTranslation } from '../../../hooks/use-translation-wrapper';
7
-
8
- const GROUP_NAME = 'networkType';
9
-
10
- export interface NetworkTypeControlGroupProps {
11
- isDisabled?: boolean;
12
- isSDNSelectable: boolean;
13
- }
14
-
15
- export const NetworkTypeControlGroup = ({
16
- isDisabled = false,
17
- isSDNSelectable,
18
- }: NetworkTypeControlGroupProps) => {
19
- const { t } = useTranslation();
20
- return (
21
- <FormGroup isInline fieldId={GROUP_NAME} label={t('ai:Network type')}>
22
- <Split>
23
- <SplitItem>
24
- <Tooltip
25
- hidden={isSDNSelectable}
26
- content={t(
27
- 'ai:Network type selection is not supported for SNO clusters or when IPv6 is detected.',
28
- )}
29
- >
30
- <RadioField
31
- id={GROUP_NAME}
32
- name={GROUP_NAME}
33
- isDisabled={isDisabled || !isSDNSelectable}
34
- value={NETWORK_TYPE_OVN}
35
- label={<>{t('ai:Open Virtual Networking (OVN)')}&nbsp;</>}
36
- />
37
- </Tooltip>
38
- </SplitItem>
39
- <SplitItem>
40
- <PopoverIcon
41
- bodyContent={t(
42
- "ai:OVN separates the physical network topology from the logical one and is recommended if you're using new or telco features.",
43
- )}
44
- buttonStyle={{ top: '-4px' }}
45
- />
46
- </SplitItem>
47
- </Split>
48
- <Split>
49
- <SplitItem>
50
- <Tooltip
51
- hidden={isSDNSelectable}
52
- content={t(
53
- 'ai:Network type selection is not supported for SNO clusters or when IPv6 is detected.',
54
- )}
55
- >
56
- <RadioField
57
- id={GROUP_NAME}
58
- name={GROUP_NAME}
59
- isDisabled={isDisabled || !isSDNSelectable}
60
- value={NETWORK_TYPE_SDN}
61
- label={<>{t('ai:Software-Defined Networking (SDN)')}&nbsp;</>}
62
- />
63
- </Tooltip>
64
- </SplitItem>
65
- <SplitItem>
66
- <PopoverIcon
67
- bodyContent={t('ai:The classic bullet-proof networking type')}
68
- buttonStyle={{ top: '-4px' }}
69
- />
70
- </SplitItem>
71
- </Split>
72
- </FormGroup>
73
- );
74
- };