@openshift-assisted/ui-lib 2.46.3 → 2.47.1

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 (133) hide show
  1. package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
  2. package/build/@types/cim/types/k8s/agent-cluster-install.d.ts +1 -0
  3. package/build/@types/cim/types/k8s/agent-cluster-install.d.ts.map +1 -1
  4. package/build/@types/common/api/assisted-service/BundleAPI.d.ts +2 -2
  5. package/build/@types/common/api/assisted-service/ClustersAPI.d.ts +25 -25
  6. package/build/@types/common/api/assisted-service/ComponentVersionsAPI.d.ts +1 -1
  7. package/build/@types/common/api/assisted-service/EventsAPI.d.ts +1 -1
  8. package/build/@types/common/api/assisted-service/HostsAPI.d.ts +6 -6
  9. package/build/@types/common/api/assisted-service/InfraEnvsAPI.d.ts +7 -7
  10. package/build/@types/common/api/assisted-service/ManagedDomainsAPI.d.ts +1 -1
  11. package/build/@types/common/api/assisted-service/NewFeatureSupportLevelsAPI.d.ts +2 -2
  12. package/build/@types/common/api/assisted-service/OperatorsAPI.d.ts +1 -1
  13. package/build/@types/common/api/assisted-service/SupportedOpenshiftVersionsAPI.d.ts +1 -1
  14. package/build/@types/common/api/assisted-service/UISettingsAPI.d.ts +2 -2
  15. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts +2 -1
  16. package/build/@types/common/components/clusterConfiguration/ControlPlaneNodesDropdown.d.ts.map +1 -1
  17. package/build/@types/common/components/clusterConfiguration/DownloadIso.d.ts.map +1 -1
  18. package/build/@types/common/components/clusterConfiguration/OcmTNADisclaimer.d.ts.map +1 -0
  19. package/build/@types/common/components/clusterConfiguration/utils.d.ts +3 -1
  20. package/build/@types/common/components/clusterConfiguration/utils.d.ts.map +1 -1
  21. package/build/@types/common/components/clusterConfiguration/utils.test.d.ts +2 -0
  22. package/build/@types/common/components/clusterConfiguration/utils.test.d.ts.map +1 -0
  23. package/build/@types/common/components/ui/formik/validationSchemas.d.ts +1 -1
  24. package/build/@types/common/components/ui/formik/validationSchemas.d.ts.map +1 -1
  25. package/build/@types/common/config/constants.d.ts.map +1 -1
  26. package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.d.ts.map +1 -1
  27. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.d.ts.map +1 -1
  28. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.d.ts +2 -1
  29. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.d.ts.map +1 -1
  30. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.d.ts.map +1 -1
  31. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
  32. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.d.ts.map +1 -1
  33. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.d.ts.map +1 -1
  34. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.d.ts.map +1 -1
  35. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts +1 -1
  36. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts.map +1 -1
  37. package/build/@types/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.d.ts.map +1 -1
  38. package/build/@types/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.d.ts.map +1 -1
  39. package/build/@types/ocm/components/clusterDetail/ClusterProperties.d.ts.map +1 -1
  40. package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts +2 -0
  41. package/build/@types/ocm/components/clusterDetail/ClusterProperties.test.d.ts.map +1 -0
  42. package/build/@types/ocm/components/clusterWizard/OperatorsBundle.d.ts.map +1 -1
  43. package/build/@types/ocm/services/ClustersService.d.ts +5 -5
  44. package/build/@types/ocm/services/HostsService.d.ts +11 -11
  45. package/build/@types/ocm/services/InfraEnvsService.d.ts +2 -2
  46. package/build/@types/ocm/services/UISettingsService.d.ts +1 -1
  47. package/build/@types/ocm/store/slices/infra-envs/thunks.d.ts +1 -1
  48. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +9 -5
  49. package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
  50. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js +23 -6
  51. package/build/cjs/common/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
  52. package/build/cjs/common/components/clusterConfiguration/DownloadIso.js +1 -2
  53. package/build/cjs/common/components/clusterConfiguration/DownloadIso.js.map +1 -1
  54. package/build/cjs/{ocm → common}/components/clusterConfiguration/OcmTNADisclaimer.js +1 -1
  55. package/build/cjs/common/components/clusterConfiguration/OcmTNADisclaimer.js.map +1 -0
  56. package/build/cjs/common/components/clusterConfiguration/utils.js +23 -12
  57. package/build/cjs/common/components/clusterConfiguration/utils.js.map +1 -1
  58. package/build/cjs/common/components/clusterConfiguration/utils.test.js +242 -0
  59. package/build/cjs/common/components/clusterConfiguration/utils.test.js.map +1 -0
  60. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +1 -1
  61. package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
  62. package/build/cjs/common/components/ui/formik/validationSchemas.js +13 -3
  63. package/build/cjs/common/components/ui/formik/validationSchemas.js.map +1 -1
  64. package/build/cjs/common/config/constants.js +5 -10
  65. package/build/cjs/common/config/constants.js.map +1 -1
  66. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js +1 -1
  67. package/build/cjs/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.js.map +1 -1
  68. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.js +0 -1
  69. package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.js.map +1 -1
  70. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js +55 -13
  71. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js.map +1 -1
  72. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.js +49 -12
  73. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.js.map +1 -1
  74. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js +3 -3
  75. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js.map +1 -1
  76. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +1 -1
  77. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
  78. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js +67 -7
  79. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js.map +1 -1
  80. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js +36 -6
  81. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.js.map +1 -1
  82. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js +29 -20
  83. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js.map +1 -1
  84. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js +40 -35
  85. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.js.map +1 -1
  86. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js +26 -8
  87. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.js.map +1 -1
  88. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.js +5 -5
  89. package/build/cjs/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.js.map +1 -1
  90. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js +2 -2
  91. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.js.map +1 -1
  92. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.test.js +180 -0
  93. package/build/cjs/ocm/components/clusterDetail/ClusterProperties.test.js.map +1 -0
  94. package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js +3 -1
  95. package/build/cjs/ocm/components/clusterWizard/OperatorsBundle.js.map +1 -1
  96. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +0 -3
  97. package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
  98. package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +17 -35
  99. package/lib/cim/types/k8s/agent-cluster-install.ts +1 -0
  100. package/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +61 -31
  101. package/lib/common/components/clusterConfiguration/DownloadIso.tsx +5 -2
  102. package/lib/{ocm → common}/components/clusterConfiguration/OcmTNADisclaimer.tsx +1 -1
  103. package/lib/common/components/clusterConfiguration/utils.test.ts +275 -0
  104. package/lib/common/components/clusterConfiguration/utils.ts +28 -9
  105. package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -1
  106. package/lib/common/components/ui/formik/_validationSchemas.test.ts +82 -0
  107. package/lib/common/components/ui/formik/validationSchemas.ts +16 -10
  108. package/lib/common/config/constants.ts +5 -11
  109. package/lib/ocm/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +1 -1
  110. package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/ExpandedManifest.tsx +1 -7
  111. package/lib/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.tsx +59 -13
  112. package/lib/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.tsx +98 -38
  113. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx +3 -2
  114. package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +3 -2
  115. package/lib/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.tsx +78 -11
  116. package/lib/ocm/components/clusterConfiguration/networkConfiguration/SubnetsDropdown.tsx +83 -10
  117. package/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx +70 -14
  118. package/lib/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.ts +30 -11
  119. package/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx +34 -4
  120. package/lib/ocm/components/clusterConfiguration/review/ReviewPreflightChecks.tsx +7 -9
  121. package/lib/ocm/components/clusterDetail/ClusterProperties.test.ts +215 -0
  122. package/lib/ocm/components/clusterDetail/ClusterProperties.tsx +2 -2
  123. package/lib/ocm/components/clusterWizard/OperatorsBundle.tsx +3 -1
  124. package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +1 -3
  125. package/package.json +3 -3
  126. package/build/@types/ocm/components/clusterConfiguration/OcmTNADisclaimer.d.ts.map +0 -1
  127. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.d.ts +0 -6
  128. package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.d.ts.map +0 -1
  129. package/build/cjs/ocm/components/clusterConfiguration/OcmTNADisclaimer.js.map +0 -1
  130. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.js +0 -25
  131. package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.js.map +0 -1
  132. package/lib/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.tsx +0 -30
  133. /package/build/@types/{ocm → common}/components/clusterConfiguration/OcmTNADisclaimer.d.ts +0 -0
@@ -34,7 +34,7 @@ export const getNetworkInitialValues = (
34
34
  isClusterManagedNetworkingUnsupported: boolean,
35
35
  ): NetworkConfigurationValues => {
36
36
  const isSNOCluster = isSNO(cluster);
37
- const isDualStackType = isDualStack(cluster);
37
+ const isDualStackType = isDualStack({ ...cluster, openshiftVersion: cluster.openshiftVersion });
38
38
 
39
39
  return {
40
40
  apiVips: cluster.apiVips,
@@ -54,22 +54,37 @@ export const getNetworkInitialValues = (
54
54
  cluster.clusterNetworks ||
55
55
  (isDualStackType
56
56
  ? defaultNetworkValues.clusterNetworksDualstack
57
- : defaultNetworkValues.clusterNetworksIpv4),
57
+ : defaultNetworkValues.clusterNetworksIpv4?.map((network) => ({
58
+ ...network,
59
+ clusterId: cluster.id,
60
+ }))),
58
61
  serviceNetworks:
59
62
  cluster.serviceNetworks ||
60
63
  (isDualStackType
61
64
  ? defaultNetworkValues.serviceNetworksDualstack
62
- : defaultNetworkValues.serviceNetworksIpv4),
65
+ : defaultNetworkValues.serviceNetworksIpv4?.map((network) => ({
66
+ ...network,
67
+ clusterId: cluster.id,
68
+ }))),
63
69
  };
64
70
  };
65
71
 
66
72
  export const getNetworkConfigurationValidationSchema = (
67
73
  initialValues: NetworkConfigurationValues,
68
74
  hostSubnets: HostSubnets,
75
+ openshiftVersion?: string,
69
76
  ) =>
70
- Yup.lazy((values: NetworkConfigurationValues) =>
71
- Yup.object<NetworkConfigurationValues>().shape({
72
- apiVips: vipArrayValidationSchema<ApiVip>(hostSubnets, values, initialValues.apiVips),
77
+ Yup.lazy((values: NetworkConfigurationValues) => {
78
+ const apiVipSchema =
79
+ values.stackType === DUAL_STACK
80
+ ? vipArrayValidationSchema<ApiVip>(hostSubnets, values, initialValues.apiVips).min(
81
+ 2,
82
+ 'Provide both Primary and Secondary API IPs.',
83
+ )
84
+ : vipArrayValidationSchema<ApiVip>(hostSubnets, values, initialValues.apiVips);
85
+
86
+ return Yup.object<NetworkConfigurationValues>().shape({
87
+ apiVips: apiVipSchema,
73
88
  ingressVips: vipArrayValidationSchema<IngressVip>(
74
89
  hostSubnets,
75
90
  values,
@@ -85,7 +100,7 @@ export const getNetworkConfigurationValidationSchema = (
85
100
  otherwise: () =>
86
101
  values.machineNetworks && values.machineNetworks?.length >= 2
87
102
  ? machineNetworksValidationSchema.concat(
88
- dualStackValidationSchema('machine networks'),
103
+ dualStackValidationSchema('machine networks', openshiftVersion),
89
104
  )
90
105
  : Yup.array(),
91
106
  }),
@@ -94,7 +109,9 @@ export const getNetworkConfigurationValidationSchema = (
94
109
  then: () => clusterNetworksValidationSchema.concat(IPv4ValidationSchema),
95
110
  otherwise: () =>
96
111
  values.clusterNetworks && values.clusterNetworks?.length >= 2
97
- ? clusterNetworksValidationSchema.concat(dualStackValidationSchema('cluster network'))
112
+ ? clusterNetworksValidationSchema.concat(
113
+ dualStackValidationSchema('cluster network', openshiftVersion),
114
+ )
98
115
  : Yup.array(),
99
116
  }),
100
117
  serviceNetworks: serviceNetworkValidationSchema.when('stackType', {
@@ -102,8 +119,10 @@ export const getNetworkConfigurationValidationSchema = (
102
119
  then: () => serviceNetworkValidationSchema.concat(IPv4ValidationSchema),
103
120
  otherwise: () =>
104
121
  values.serviceNetworks && values.serviceNetworks?.length >= 2
105
- ? serviceNetworkValidationSchema.concat(dualStackValidationSchema('service network'))
122
+ ? serviceNetworkValidationSchema.concat(
123
+ dualStackValidationSchema('service network', openshiftVersion),
124
+ )
106
125
  : Yup.array(),
107
126
  }),
108
- }),
109
- );
127
+ });
128
+ });
@@ -58,7 +58,16 @@ export const ReviewNetworkingTable = ({ cluster }: { cluster: Cluster }) => {
58
58
  )),
59
59
  props: { 'data-testid': 'machine-networks' },
60
60
  },
61
- isDualStack(cluster) ? { title: 'Primary' } : { title: '' },
61
+ isDualStack({ ...cluster, openshiftVersion: cluster.openshiftVersion })
62
+ ? {
63
+ title: cluster.machineNetworks?.map((network, index) => (
64
+ <span key={network.cidr}>
65
+ {index === 0 ? 'Primary' : 'Secondary'}
66
+ <br />
67
+ </span>
68
+ )),
69
+ }
70
+ : { title: '' },
62
71
  ],
63
72
  });
64
73
 
@@ -106,7 +115,14 @@ export const ReviewNetworkingTable = ({ cluster }: { cluster: Cluster }) => {
106
115
  )),
107
116
  props: { 'data-testid': 'cluster-network-cidr' },
108
117
  },
109
- isDualStack(cluster) && { title: 'Primary' },
118
+ isDualStack({ ...cluster, openshiftVersion: cluster.openshiftVersion }) && {
119
+ title: cluster.clusterNetworks?.map((network, index) => (
120
+ <span key={network.cidr}>
121
+ {index === 0 ? 'Primary' : 'Secondary'}
122
+ <br />
123
+ </span>
124
+ )),
125
+ },
110
126
  ].filter(Boolean),
111
127
  },
112
128
  {
@@ -122,7 +138,14 @@ export const ReviewNetworkingTable = ({ cluster }: { cluster: Cluster }) => {
122
138
  )),
123
139
  props: { 'data-testid': 'cluster-network-prefix' },
124
140
  },
125
- isDualStack(cluster) && { title: 'Primary' },
141
+ isDualStack({ ...cluster, openshiftVersion: cluster.openshiftVersion }) && {
142
+ title: cluster.clusterNetworks?.map((network, index) => (
143
+ <span key={network.hostPrefix}>
144
+ {index === 0 ? 'Primary' : 'Secondary'}
145
+ <br />
146
+ </span>
147
+ )),
148
+ },
126
149
  ].filter(Boolean),
127
150
  },
128
151
  {
@@ -138,7 +161,14 @@ export const ReviewNetworkingTable = ({ cluster }: { cluster: Cluster }) => {
138
161
  )),
139
162
  props: { 'data-testid': 'service-network-cidr' },
140
163
  },
141
- isDualStack(cluster) && { title: 'Primary' },
164
+ isDualStack({ ...cluster, openshiftVersion: cluster.openshiftVersion }) && {
165
+ title: cluster.serviceNetworks?.map((network, index) => (
166
+ <span key={network.cidr}>
167
+ {index === 0 ? 'Primary' : 'Secondary'}
168
+ <br />
169
+ </span>
170
+ )),
171
+ },
142
172
  ].filter(Boolean),
143
173
  },
144
174
  {
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import {
3
+ Content,
3
4
  Divider,
4
5
  ExpandableSection,
5
- Flex,
6
- FlexItem,
7
6
  Grid,
8
7
  GridItem,
9
8
  gridSpans,
@@ -94,12 +93,9 @@ const PreflightCheckInfo = ({
94
93
  }) => {
95
94
  return (
96
95
  <GridItem span={span} offset={offset} className={className}>
97
- <Flex spaceItems={{ default: 'spaceItemsSm' }} alignItems={{ default: 'alignItemsCenter' }}>
98
- <FlexItem style={{ display: 'flex', alignItems: 'center' }}>{icon}</FlexItem>
99
- <FlexItem style={{ display: 'flex', alignItems: 'center' }}>
100
- <b>{title}</b>
101
- </FlexItem>
102
- </Flex>
96
+ <Content className="pf-v6-u-text-wrap pf-v6-u-font-weight-bold">
97
+ {icon} {title}
98
+ </Content>
103
99
  </GridItem>
104
100
  );
105
101
  };
@@ -186,7 +182,9 @@ const ReviewPreflightChecks = ({ cluster }: { cluster: Cluster }) => {
186
182
  <ExpandableSection
187
183
  toggleContent={
188
184
  <Grid>
189
- <GridItem span={2}>Preflight checks</GridItem>
185
+ <GridItem span={2} className="pf-v6-u-text-wrap">
186
+ Preflight checks
187
+ </GridItem>
190
188
  {!isChecksExpanded && <PreflightChecksDetailCollapsed cluster={cluster} />}
191
189
  </Grid>
192
190
  }
@@ -0,0 +1,215 @@
1
+ import { test, describe, expect } from 'vitest';
2
+ import { getStackTypeLabel } from './ClusterProperties';
3
+ import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
4
+
5
+ const createCluster = (overrides: Partial<Cluster> = {}): Cluster =>
6
+ ({
7
+ id: 'test-cluster',
8
+ name: 'test-cluster',
9
+ kind: 'Cluster',
10
+ href: '/api/assisted-install/v2/clusters/test-cluster',
11
+ openshiftVersion: '4.11',
12
+ status: 'ready',
13
+ statusInfo: 'Cluster is ready',
14
+ machineNetworks: [],
15
+ clusterNetworks: [],
16
+ serviceNetworks: [],
17
+ ...overrides,
18
+ } as Cluster);
19
+
20
+ const createMachineNetwork = (cidr: string) => ({ cidr, clusterId: 'test' });
21
+ const createClusterNetwork = (cidr: string, hostPrefix: number) => ({
22
+ cidr,
23
+ hostPrefix,
24
+ clusterId: 'test',
25
+ });
26
+ const createServiceNetwork = (cidr: string) => ({ cidr, clusterId: 'test' });
27
+
28
+ describe('getStackTypeLabel', () => {
29
+ describe('OCP < 4.12 (legacy behavior)', () => {
30
+ test('returns "Dual-stack" for valid dual stack with IPv4 primary', () => {
31
+ const cluster = createCluster({
32
+ openshiftVersion: '4.11',
33
+ machineNetworks: [
34
+ createMachineNetwork('192.168.1.0/24'),
35
+ createMachineNetwork('2001:db8::/64'),
36
+ ],
37
+ clusterNetworks: [
38
+ createClusterNetwork('10.128.0.0/14', 23),
39
+ createClusterNetwork('fd01::/48', 64),
40
+ ],
41
+ serviceNetworks: [
42
+ createServiceNetwork('172.30.0.0/16'),
43
+ createServiceNetwork('fd02::/112'),
44
+ ],
45
+ });
46
+
47
+ expect(getStackTypeLabel(cluster)).toBe('Dual-stack');
48
+ });
49
+
50
+ test('returns "IPv4" for single stack', () => {
51
+ const cluster = createCluster({
52
+ openshiftVersion: '4.11',
53
+ machineNetworks: [createMachineNetwork('192.168.1.0/24')],
54
+ clusterNetworks: [createClusterNetwork('10.128.0.0/14', 23)],
55
+ serviceNetworks: [createServiceNetwork('172.30.0.0/16')],
56
+ });
57
+
58
+ expect(getStackTypeLabel(cluster)).toBe('IPv4');
59
+ });
60
+
61
+ test('returns "IPv4" for IPv6 primary (invalid for OCP < 4.12)', () => {
62
+ const cluster = createCluster({
63
+ openshiftVersion: '4.11',
64
+ machineNetworks: [
65
+ createMachineNetwork('2001:db8::/64'),
66
+ createMachineNetwork('192.168.1.0/24'),
67
+ ],
68
+ clusterNetworks: [
69
+ createClusterNetwork('fd01::/48', 64),
70
+ createClusterNetwork('10.128.0.0/14', 23),
71
+ ],
72
+ serviceNetworks: [
73
+ createServiceNetwork('fd02::/112'),
74
+ createServiceNetwork('172.30.0.0/16'),
75
+ ],
76
+ });
77
+
78
+ expect(getStackTypeLabel(cluster)).toBe('IPv4');
79
+ });
80
+ });
81
+
82
+ describe('OCP >= 4.12 (new behavior)', () => {
83
+ test('returns "Dual-stack" for IPv4 primary and IPv6 secondary', () => {
84
+ const cluster = createCluster({
85
+ openshiftVersion: '4.12',
86
+ machineNetworks: [
87
+ createMachineNetwork('192.168.1.0/24'),
88
+ createMachineNetwork('2001:db8::/64'),
89
+ ],
90
+ clusterNetworks: [
91
+ createClusterNetwork('10.128.0.0/14', 23),
92
+ createClusterNetwork('fd01::/48', 64),
93
+ ],
94
+ serviceNetworks: [
95
+ createServiceNetwork('172.30.0.0/16'),
96
+ createServiceNetwork('fd02::/112'),
97
+ ],
98
+ });
99
+
100
+ expect(getStackTypeLabel(cluster)).toBe('Dual-stack');
101
+ });
102
+
103
+ test('returns "Dual-stack" for IPv6 primary and IPv4 secondary', () => {
104
+ const cluster = createCluster({
105
+ openshiftVersion: '4.12',
106
+ machineNetworks: [
107
+ createMachineNetwork('2001:db8::/64'),
108
+ createMachineNetwork('192.168.1.0/24'),
109
+ ],
110
+ clusterNetworks: [
111
+ createClusterNetwork('fd01::/48', 64),
112
+ createClusterNetwork('10.128.0.0/14', 23),
113
+ ],
114
+ serviceNetworks: [
115
+ createServiceNetwork('fd02::/112'),
116
+ createServiceNetwork('172.30.0.0/16'),
117
+ ],
118
+ });
119
+
120
+ expect(getStackTypeLabel(cluster)).toBe('Dual-stack');
121
+ });
122
+
123
+ test('returns "IPv4" for IPv6 primary and IPv6 secondary (not dual-stack)', () => {
124
+ const cluster = createCluster({
125
+ openshiftVersion: '4.12',
126
+ machineNetworks: [
127
+ createMachineNetwork('2001:db8::/64'),
128
+ createMachineNetwork('2001:db9::/64'),
129
+ ],
130
+ clusterNetworks: [
131
+ createClusterNetwork('fd01::/48', 64),
132
+ createClusterNetwork('fd02::/48', 64),
133
+ ],
134
+ serviceNetworks: [createServiceNetwork('fd03::/112'), createServiceNetwork('fd04::/112')],
135
+ });
136
+
137
+ expect(getStackTypeLabel(cluster)).toBe('IPv4');
138
+ });
139
+
140
+ test('returns "IPv4" for IPv4 primary and IPv4 secondary (not dual-stack)', () => {
141
+ const cluster = createCluster({
142
+ openshiftVersion: '4.12',
143
+ machineNetworks: [
144
+ createMachineNetwork('192.168.1.0/24'),
145
+ createMachineNetwork('10.0.0.0/24'),
146
+ ],
147
+ clusterNetworks: [
148
+ createClusterNetwork('10.128.0.0/14', 23),
149
+ createClusterNetwork('172.16.0.0/14', 23),
150
+ ],
151
+ serviceNetworks: [
152
+ createServiceNetwork('172.30.0.0/16'),
153
+ createServiceNetwork('172.31.0.0/16'),
154
+ ],
155
+ });
156
+
157
+ expect(getStackTypeLabel(cluster)).toBe('IPv4');
158
+ });
159
+
160
+ test('returns "IPv4" for single stack', () => {
161
+ const cluster = createCluster({
162
+ openshiftVersion: '4.12',
163
+ machineNetworks: [createMachineNetwork('192.168.1.0/24')],
164
+ clusterNetworks: [createClusterNetwork('10.128.0.0/14', 23)],
165
+ serviceNetworks: [createServiceNetwork('172.30.0.0/16')],
166
+ });
167
+
168
+ expect(getStackTypeLabel(cluster)).toBe('IPv4');
169
+ });
170
+ });
171
+
172
+ describe('edge cases', () => {
173
+ test('handles undefined openshiftVersion', () => {
174
+ const cluster = createCluster({
175
+ openshiftVersion: undefined,
176
+ machineNetworks: [
177
+ createMachineNetwork('192.168.1.0/24'),
178
+ createMachineNetwork('2001:db8::/64'),
179
+ ],
180
+ clusterNetworks: [
181
+ createClusterNetwork('10.128.0.0/14', 23),
182
+ createClusterNetwork('fd01::/48', 64),
183
+ ],
184
+ serviceNetworks: [
185
+ createServiceNetwork('172.30.0.0/16'),
186
+ createServiceNetwork('fd02::/112'),
187
+ ],
188
+ });
189
+
190
+ expect(getStackTypeLabel(cluster)).toBe('Dual-stack');
191
+ });
192
+
193
+ test('handles empty networks', () => {
194
+ const cluster = createCluster({
195
+ openshiftVersion: '4.12',
196
+ machineNetworks: [],
197
+ clusterNetworks: [],
198
+ serviceNetworks: [],
199
+ });
200
+
201
+ expect(getStackTypeLabel(cluster)).toBe('IPv4');
202
+ });
203
+
204
+ test('handles undefined networks', () => {
205
+ const cluster = createCluster({
206
+ openshiftVersion: '4.12',
207
+ machineNetworks: undefined,
208
+ clusterNetworks: undefined,
209
+ serviceNetworks: undefined,
210
+ });
211
+
212
+ expect(getStackTypeLabel(cluster)).toBe('IPv4');
213
+ });
214
+ });
215
+ });
@@ -41,7 +41,7 @@ export const getManagementType = ({ userManagedNetworking }: Cluster): string =>
41
41
  };
42
42
 
43
43
  export const getStackTypeLabel = (cluster: Cluster): string =>
44
- isDualStack(cluster) ? 'Dual-stack' : 'IPv4';
44
+ isDualStack({ ...cluster, openshiftVersion: cluster.openshiftVersion }) ? 'Dual-stack' : 'IPv4';
45
45
 
46
46
  export const getDiskEncryptionEnabledOnStatus = (diskEncryption: DiskEncryption['enableOn']) => {
47
47
  let diskEncryptionType = null;
@@ -67,7 +67,7 @@ export const getDiskEncryptionEnabledOnStatus = (diskEncryption: DiskEncryption[
67
67
 
68
68
  const ClusterProperties = ({ cluster, externalMode = false }: ClusterPropertiesProps) => {
69
69
  const { t } = useTranslation();
70
- const isDualStackType = isDualStack(cluster);
70
+ const isDualStackType = isDualStack({ ...cluster, openshiftVersion: cluster.openshiftVersion });
71
71
  const featureSupportLevelContext = useNewFeatureSupportLevel();
72
72
 
73
73
  const activeFeatureConfiguration = featureSupportLevelContext.activeFeatureConfiguration;
@@ -106,7 +106,9 @@ const BundleCard = ({
106
106
  const disabledReason = hasUnsupportedOperators
107
107
  ? 'Some operators in this bundle are not supported with the current configuration.'
108
108
  : isSNO && bundleSpec?.noSNO
109
- ? 'This bundle is not available when deploying a Single Node OpenShift.'
109
+ ? bundle.id === 'openshift-ai'
110
+ ? 'This bundle is not available when deploying a Single Node OpenShift, but you can use the standalone operator instead.'
111
+ : 'This bundle is not available when deploying a Single Node OpenShift.'
110
112
  : incompatibleBundle
111
113
  ? `Bundle cannot be installed together with ${
112
114
  bundles.find(({ id }) => id === incompatibleBundle)?.title || incompatibleBundle
@@ -294,9 +294,7 @@ const getOpenShiftAIDisabledReason = (
294
294
  if (isArm) {
295
295
  return `${operatorTitle} is not available when ARM CPU architecture is selected.`;
296
296
  }
297
- if (isSNO(cluster)) {
298
- return `${operatorTitle} is not available when deploying a Single Node OpenShift.`;
299
- }
297
+
300
298
  if (!isSupported) {
301
299
  return `The installer cannot currently enable ${operatorTitle} with the selected OpenShift version, but it can be enabled later through the OpenShift Console once the installation is complete.`;
302
300
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@openshift-assisted/locales": "2.46.3",
4
- "@openshift-assisted/types": "2.46.3",
3
+ "@openshift-assisted/locales": "2.47.1",
4
+ "@openshift-assisted/types": "2.47.1",
5
5
  "@openshift-console/dynamic-plugin-sdk": "0.0.3",
6
6
  "@patternfly/patternfly": "6.2.3",
7
7
  "@patternfly/react-code-editor": "6.2.2",
@@ -140,5 +140,5 @@
140
140
  ]
141
141
  }
142
142
  },
143
- "version": "2.46.3"
143
+ "version": "2.47.1"
144
144
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"OcmTNADisclaimer.d.ts","sourceRoot":"","sources":["../../../../../lib/ocm/components/clusterConfiguration/OcmTNADisclaimer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,gBAAgB,yBAgBrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export interface UserManagedNetworkingTextContentProps {
3
- shouldDisplayLoadBalancersBullet?: boolean;
4
- }
5
- export declare const UserManagedNetworkingTextContent: ({ shouldDisplayLoadBalancersBullet, }: UserManagedNetworkingTextContentProps) => React.JSX.Element;
6
- //# sourceMappingURL=UserManagedNetworkingTextContent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserManagedNetworkingTextContent.d.ts","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,qCAAqC;IACpD,gCAAgC,CAAC,EAAE,OAAO,CAAC;CAC5C;AAED,eAAO,MAAM,gCAAgC,0CAE1C,qCAAqC,sBAkBvC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"OcmTNADisclaimer.js","sourceRoot":"","sources":["../../../../../lib/ocm/components/clusterConfiguration/OcmTNADisclaimer.tsx"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,uDAA6E;AAC7E,2FAA+E;AAE/E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,wCAAc,GAAE,CAAC;IAE/B,OAAO,CACL,8BAAC,kBAAK,IACJ,OAAO,EAAE,yBAAY,CAAC,IAAI,EAC1B,KAAK,EAAE,CAAC,CAAC,sDAAsD,CAAC,EAChE,QAAQ;QAER,8BAAC,iBAAI;YACH,8BAAC,qBAAQ,QACN,CAAC,CAAC,+EAA+E,CAAC,CAC1E,CACN,CACD,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserManagedNetworkingTextContent = 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 ui_1 = require("../../../../common/components/ui");
8
- const docs_links_1 = require("../../../../common/config/docs_links");
9
- const UserManagedNetworkingTextContent = ({ shouldDisplayLoadBalancersBullet = false, }) => {
10
- return (react_1.default.createElement(react_core_1.Content, null,
11
- react_1.default.createElement(react_core_1.Content, { component: 'p' },
12
- "Please refer to the",
13
- ' ',
14
- react_1.default.createElement(ui_1.ExternalLink, { href: (0, docs_links_1.getOpenShiftNetworkingDocsLink)() }, "OpenShift networking documentation"),
15
- ' ',
16
- "to configure your cluster's networking, including:",
17
- ' '),
18
- react_1.default.createElement(react_core_1.List, null,
19
- react_1.default.createElement(react_core_1.ListItem, null, "DHCP or static IP Addresses"),
20
- shouldDisplayLoadBalancersBullet && react_1.default.createElement(react_core_1.ListItem, null, "Load balancers"),
21
- react_1.default.createElement(react_core_1.ListItem, null, "Network ports"),
22
- react_1.default.createElement(react_core_1.ListItem, null, "DNS"))));
23
- };
24
- exports.UserManagedNetworkingTextContent = UserManagedNetworkingTextContent;
25
- //# sourceMappingURL=UserManagedNetworkingTextContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserManagedNetworkingTextContent.js","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterConfiguration/networkConfiguration/UserManagedNetworkingTextContent.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,uDAAiE;AACjE,yDAAgE;AAChE,qEAAsF;AAM/E,MAAM,gCAAgC,GAAG,CAAC,EAC/C,gCAAgC,GAAG,KAAK,GACF,EAAE,EAAE;IAC1C,OAAO,CACL,8BAAC,oBAAO;QACN,8BAAC,oBAAO,IAAC,SAAS,EAAE,GAAG;;YACD,GAAG;YACvB,8BAAC,iBAAY,IAAC,IAAI,EAAE,IAAA,2CAA8B,GAAE,yCAErC;YAAC,GAAG;;YACgC,GAAG,CAC9C;QACV,8BAAC,iBAAI;YACH,8BAAC,qBAAQ,sCAAuC;YAC/C,gCAAgC,IAAI,8BAAC,qBAAQ,yBAA0B;YACxE,8BAAC,qBAAQ,wBAAyB;YAClC,8BAAC,qBAAQ,cAAe,CACnB,CACC,CACX,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,gCAAgC,oCAoB3C"}
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { List, ListItem, Content } from '@patternfly/react-core';
3
- import { ExternalLink } from '../../../../common/components/ui';
4
- import { getOpenShiftNetworkingDocsLink } from '../../../../common/config/docs_links';
5
-
6
- export interface UserManagedNetworkingTextContentProps {
7
- shouldDisplayLoadBalancersBullet?: boolean;
8
- }
9
-
10
- export const UserManagedNetworkingTextContent = ({
11
- shouldDisplayLoadBalancersBullet = false,
12
- }: UserManagedNetworkingTextContentProps) => {
13
- return (
14
- <Content>
15
- <Content component={'p'}>
16
- Please refer to the{' '}
17
- <ExternalLink href={getOpenShiftNetworkingDocsLink()}>
18
- OpenShift networking documentation
19
- </ExternalLink>{' '}
20
- to configure your cluster's networking, including:{' '}
21
- </Content>
22
- <List>
23
- <ListItem>DHCP or static IP Addresses</ListItem>
24
- {shouldDisplayLoadBalancersBullet && <ListItem>Load balancers</ListItem>}
25
- <ListItem>Network ports</ListItem>
26
- <ListItem>DNS</ListItem>
27
- </List>
28
- </Content>
29
- );
30
- };