@openshift-assisted/ui-lib 2.8.2-cim → 2.9.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/@types/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.d.ts.map +1 -1
- package/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.d.ts.map +1 -1
- package/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.d.ts.map +1 -1
- package/@types/cim/components/ClusterDeployment/validationSchemas.d.ts.map +1 -1
- package/@types/cim/components/Hypershift/HostedClusterWizard/NetworkStep/types.d.ts +0 -1
- package/@types/cim/components/Hypershift/HostedClusterWizard/NetworkStep/types.d.ts.map +1 -1
- package/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
- package/@types/cim/components/modals/AddHostModal.d.ts.map +1 -1
- package/@types/cim/components/modals/EditProxyModal.d.ts.map +1 -1
- package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts +1 -0
- package/@types/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts.map +1 -1
- package/@types/common/components/clusterWizard/ClusterWizardStep.d.ts +1 -1
- package/@types/common/components/clusterWizard/ClusterWizardStep.d.ts.map +1 -1
- package/@types/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.d.ts.map +1 -1
- package/@types/common/components/fetching/EventListFetch.d.ts.map +1 -1
- package/@types/common/components/ui/ClusterEventsToolbar.d.ts.map +1 -1
- package/@types/common/components/ui/StaticTextField.d.ts +1 -1
- package/@types/common/components/ui/StaticTextField.d.ts.map +1 -1
- package/@types/common/components/ui/eventsModal.d.ts.map +1 -1
- package/@types/common/components/ui/formik/validationSchemas.d.ts +5 -1
- package/@types/common/components/ui/formik/validationSchemas.d.ts.map +1 -1
- package/@types/common/config/constants.d.ts +1 -0
- package/@types/common/config/constants.d.ts.map +1 -1
- package/@types/common/types/events.d.ts +1 -0
- package/@types/common/types/events.d.ts.map +1 -1
- package/@types/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.d.ts.map +1 -1
- package/@types/ocm/components/AddHosts/day2Wizard/Day2StaticIP.d.ts.map +1 -1
- package/@types/ocm/components/AddHosts/day2Wizard/Day2Wizard.d.ts.map +1 -1
- package/@types/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.d.ts.map +1 -1
- package/@types/ocm/components/HostsClusterDetailTab/utils.d.ts.map +1 -1
- package/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts +2 -1
- package/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
- package/@types/ocm/components/clusterConfiguration/DiscoveryImageForm.d.ts.map +1 -1
- package/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts.map +1 -1
- package/@types/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.d.ts.map +1 -1
- package/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
- package/@types/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.d.ts.map +1 -1
- package/@types/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.d.ts.map +1 -1
- package/@types/ocm/components/clusterDetail/AssistedInstallerDetailCard.d.ts.map +1 -1
- package/@types/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.d.ts.map +1 -1
- package/@types/ocm/components/clusters/ClusterPage.d.ts.map +1 -1
- package/@types/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.d.ts.map +1 -1
- package/@types/ocm/components/fetching/fetchEvents.d.ts.map +1 -1
- package/@types/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.d.ts.map +1 -1
- package/@types/ocm/hooks/useInfraEnv.d.ts +1 -1
- package/@types/ocm/hooks/useInfraEnv.d.ts.map +1 -1
- package/@types/ocm/hooks/useInfraEnvId.d.ts +1 -1
- package/@types/ocm/hooks/useInfraEnvId.d.ts.map +1 -1
- package/@types/ocm/services/Day2ClusterService.d.ts +3 -3
- package/@types/ocm/services/Day2ClusterService.d.ts.map +1 -1
- package/@types/ocm/services/InfraEnvIdsCacheService.d.ts +1 -1
- package/@types/ocm/services/InfraEnvIdsCacheService.d.ts.map +1 -1
- package/@types/ocm/services/InfraEnvsService.d.ts +4 -3
- package/@types/ocm/services/InfraEnvsService.d.ts.map +1 -1
- package/@types/ocm/services/apis/EventsAPI.d.ts +1 -0
- package/@types/ocm/services/apis/EventsAPI.d.ts.map +1 -1
- package/build/build.json +1 -1
- package/build/cim/components/Agent/BMCForm.js +1 -1
- package/build/cim/components/Agent/BMCForm.js.map +1 -1
- package/build/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js +1 -9
- package/build/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js.map +1 -1
- package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js +1 -2
- package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.js.map +1 -1
- package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.js +3 -10
- package/build/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.js.map +1 -1
- package/build/cim/components/ClusterDeployment/use-networking-formik.js +2 -2
- package/build/cim/components/ClusterDeployment/use-networking-formik.js.map +1 -1
- package/build/cim/components/ClusterDeployment/validationSchemas.js +0 -1
- package/build/cim/components/ClusterDeployment/validationSchemas.js.map +1 -1
- package/build/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.js +2 -2
- package/build/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.js.map +1 -1
- package/build/cim/components/InfraEnv/InfraEnvFormPage.js +10 -2
- package/build/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
- package/build/cim/components/modals/AddHostModal.js +1 -1
- package/build/cim/components/modals/AddHostModal.js.map +1 -1
- package/build/cim/components/modals/EditProxyModal.js +18 -7
- package/build/cim/components/modals/EditProxyModal.js.map +1 -1
- package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js +5 -5
- package/build/common/components/clusterConfiguration/DiscoveryImageConfigForm.js.map +1 -1
- package/build/common/components/clusterWizard/ClusterWizardStep.js +1 -1
- package/build/common/components/clusterWizard/ClusterWizardStep.js.map +1 -1
- package/build/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js +5 -2
- package/build/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.js.map +1 -1
- package/build/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js +1 -1
- package/build/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +1 -1
- package/build/common/components/fetching/EventListFetch.js +6 -5
- package/build/common/components/fetching/EventListFetch.js.map +1 -1
- package/build/common/components/hosts/status.js +1 -1
- package/build/common/components/hosts/status.js.map +1 -1
- package/build/common/components/ui/ClusterEventsToolbar.js +1 -1
- package/build/common/components/ui/ClusterEventsToolbar.js.map +1 -1
- package/build/common/components/ui/eventsModal.js +8 -3
- package/build/common/components/ui/eventsModal.js.map +1 -1
- package/build/common/components/ui/formik/validationSchemas.js +19 -12
- package/build/common/components/ui/formik/validationSchemas.js.map +1 -1
- package/build/common/config/constants.js +2 -0
- package/build/common/config/constants.js.map +1 -1
- package/build/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.js +94 -20
- package/build/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.js.map +1 -1
- package/build/ocm/components/AddHosts/day2Wizard/Day2DownloadISO.js +1 -1
- package/build/ocm/components/AddHosts/day2Wizard/Day2DownloadISO.js.map +1 -1
- package/build/ocm/components/AddHosts/day2Wizard/Day2StaticIP.js +16 -9
- package/build/ocm/components/AddHosts/day2Wizard/Day2StaticIP.js.map +1 -1
- package/build/ocm/components/AddHosts/day2Wizard/Day2Wizard.js +1 -1
- package/build/ocm/components/AddHosts/day2Wizard/Day2Wizard.js.map +1 -1
- package/build/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.js +5 -2
- package/build/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.js.map +1 -1
- package/build/ocm/components/HostsClusterDetailTab/utils.js +5 -2
- package/build/ocm/components/HostsClusterDetailTab/utils.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +5 -4
- package/build/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/DiscoveryImageForm.js +3 -1
- package/build/ocm/components/clusterConfiguration/DiscoveryImageForm.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js +11 -8
- package/build/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js +16 -5
- package/build/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +3 -2
- package/build/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js +1 -2
- package/build/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js +27 -16
- package/build/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.js.map +1 -1
- package/build/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegration.js +1 -1
- package/build/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegration.js.map +1 -1
- package/build/ocm/components/clusterDetail/AssistedInstallerDetailCard.js +5 -2
- package/build/ocm/components/clusterDetail/AssistedInstallerDetailCard.js.map +1 -1
- package/build/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js +5 -2
- package/build/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.js.map +1 -1
- package/build/ocm/components/clusters/ClusterPage.js +8 -4
- package/build/ocm/components/clusters/ClusterPage.js.map +1 -1
- package/build/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.js +3 -2
- package/build/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.js.map +1 -1
- package/build/ocm/components/fetching/fetchEvents.js +7 -3
- package/build/ocm/components/fetching/fetchEvents.js.map +1 -1
- package/build/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.js +3 -2
- package/build/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.js.map +1 -1
- package/build/ocm/hooks/useInfraEnv.js +2 -2
- package/build/ocm/hooks/useInfraEnv.js.map +1 -1
- package/build/ocm/hooks/useInfraEnvId.js +18 -3
- package/build/ocm/hooks/useInfraEnvId.js.map +1 -1
- package/build/ocm/hooks/useInfraEnvImageUrl.js +1 -1
- package/build/ocm/hooks/useInfraEnvImageUrl.js.map +1 -1
- package/build/ocm/hooks/useInfraEnvIpxeImageUrl.js +1 -1
- package/build/ocm/hooks/useInfraEnvIpxeImageUrl.js.map +1 -1
- package/build/ocm/services/Day2ClusterService.js +11 -20
- package/build/ocm/services/Day2ClusterService.js.map +1 -1
- package/build/ocm/services/InfraEnvIdsCacheService.js +5 -4
- package/build/ocm/services/InfraEnvIdsCacheService.js.map +1 -1
- package/build/ocm/services/InfraEnvsService.js +7 -4
- package/build/ocm/services/InfraEnvsService.js.map +1 -1
- package/build/ocm/services/apis/EventsAPI.js +13 -1
- package/build/ocm/services/apis/EventsAPI.js.map +1 -1
- package/lib/cim/components/Agent/BMCForm.tsx +1 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.tsx +1 -12
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.tsx +1 -2
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.tsx +2 -10
- package/lib/cim/components/ClusterDeployment/use-networking-formik.ts +2 -2
- package/lib/cim/components/ClusterDeployment/validationSchemas.ts +0 -1
- package/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.tsx +2 -2
- package/lib/cim/components/Hypershift/HostedClusterWizard/NetworkStep/types.ts +0 -1
- package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +10 -2
- package/lib/cim/components/modals/AddHostModal.tsx +1 -0
- package/lib/cim/components/modals/EditProxyModal.tsx +15 -3
- package/lib/common/components/clusterConfiguration/DiscoveryImageConfigForm.tsx +12 -9
- package/lib/common/components/clusterWizard/ClusterWizardStep.tsx +5 -1
- package/lib/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.tsx +11 -2
- package/lib/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.tsx +1 -1
- package/lib/common/components/fetching/EventListFetch.tsx +6 -5
- package/lib/common/components/hosts/status.tsx +1 -1
- package/lib/common/components/ui/ClusterEventsToolbar.tsx +3 -0
- package/lib/common/components/ui/StaticTextField.tsx +1 -1
- package/lib/common/components/ui/eventsModal.tsx +18 -2
- package/lib/common/components/ui/formik/validationSchemas.ts +32 -14
- package/lib/common/config/constants.ts +4 -0
- package/lib/common/types/events.ts +1 -0
- package/lib/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.tsx +129 -21
- package/lib/ocm/components/AddHosts/day2Wizard/Day2DownloadISO.tsx +1 -1
- package/lib/ocm/components/AddHosts/day2Wizard/Day2StaticIP.tsx +15 -10
- package/lib/ocm/components/AddHosts/day2Wizard/Day2Wizard.tsx +1 -0
- package/lib/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.tsx +7 -3
- package/lib/ocm/components/HostsClusterDetailTab/utils.ts +8 -3
- package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +6 -3
- package/lib/ocm/components/clusterConfiguration/DiscoveryImageForm.tsx +9 -1
- package/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx +25 -16
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.tsx +29 -8
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +9 -2
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.tsx +6 -13
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx +30 -32
- package/lib/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegration.tsx +1 -1
- package/lib/ocm/components/clusterDetail/AssistedInstallerDetailCard.tsx +12 -2
- package/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx +9 -2
- package/lib/ocm/components/clusters/ClusterPage.tsx +17 -5
- package/lib/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.tsx +6 -2
- package/lib/ocm/components/fetching/fetchEvents.ts +8 -3
- package/lib/ocm/components/newFeatureSupportLevels/NewFeatureSupportLevelProvider.tsx +6 -2
- package/lib/ocm/hooks/useInfraEnv.ts +10 -1
- package/lib/ocm/hooks/useInfraEnvId.ts +24 -4
- package/lib/ocm/hooks/useInfraEnvImageUrl.ts +1 -1
- package/lib/ocm/hooks/useInfraEnvIpxeImageUrl.ts +1 -1
- package/lib/ocm/services/Day2ClusterService.ts +12 -42
- package/lib/ocm/services/InfraEnvIdsCacheService.ts +9 -6
- package/lib/ocm/services/InfraEnvsService.ts +12 -13
- package/lib/ocm/services/apis/EventsAPI.ts +15 -1
- package/package.json +1 -1
package/lib/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
getVipValidationsById,
|
|
12
12
|
DUAL_STACK,
|
|
13
13
|
SupportLevel,
|
|
14
|
+
PopoverIcon,
|
|
14
15
|
} from '../../../../common';
|
|
15
16
|
import { selectCurrentClusterPermissionsState } from '../../../selectors';
|
|
16
17
|
import { OcmCheckboxField, OcmInputField } from '../../ui/OcmFormFields';
|
|
@@ -59,20 +60,6 @@ const VipStaticValue = ({
|
|
|
59
60
|
return <i>This IP will be allocated by the DHCP server</i>;
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
const getVipHelperSuffix = (
|
|
63
|
-
vip?: string,
|
|
64
|
-
vipDhcpAllocation?: boolean,
|
|
65
|
-
vipDhcpAllocationFormValue?: boolean,
|
|
66
|
-
): string => {
|
|
67
|
-
if (!vipDhcpAllocationFormValue) {
|
|
68
|
-
return 'Make sure that the VIP is unique and not used by any other device on your network.';
|
|
69
|
-
}
|
|
70
|
-
if (vipDhcpAllocation && vip) {
|
|
71
|
-
return 'This IP was allocated by the DHCP server.';
|
|
72
|
-
}
|
|
73
|
-
return '';
|
|
74
|
-
};
|
|
75
|
-
|
|
76
63
|
export type VirtualIPControlGroupProps = {
|
|
77
64
|
cluster: Cluster;
|
|
78
65
|
isVipDhcpAllocationDisabled?: boolean;
|
|
@@ -88,16 +75,9 @@ export const VirtualIPControlGroup = ({
|
|
|
88
75
|
const { isViewerMode } = useSelector(selectCurrentClusterPermissionsState);
|
|
89
76
|
const { t } = useTranslation();
|
|
90
77
|
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
values.vipDhcpAllocation,
|
|
95
|
-
)}`;
|
|
96
|
-
const ingressVipHelperText = `Provide an endpoint for application traffic flowing in from outside the cluster. If needed, contact your IT manager for more information. ${getVipHelperSuffix(
|
|
97
|
-
cluster.ingressVip,
|
|
98
|
-
cluster.vipDhcpAllocation,
|
|
99
|
-
values.vipDhcpAllocation,
|
|
100
|
-
)}`;
|
|
78
|
+
const ipHelperText = 'Make sure the IP is not used by any other device on your network.';
|
|
79
|
+
const ipPopoverContent =
|
|
80
|
+
'Provides an endpoint for users, both human and machine, to interact with and configure the platform.';
|
|
101
81
|
|
|
102
82
|
const {
|
|
103
83
|
'api-vip-defined': apiVipFailedValidationMessage,
|
|
@@ -150,9 +130,13 @@ export const VirtualIPControlGroup = ({
|
|
|
150
130
|
{values.vipDhcpAllocation ? (
|
|
151
131
|
<>
|
|
152
132
|
<FormikStaticField
|
|
153
|
-
label={
|
|
133
|
+
label={
|
|
134
|
+
<>
|
|
135
|
+
<span>API IP{ipFieldsSuffix}</span> <PopoverIcon bodyContent={ipPopoverContent} />
|
|
136
|
+
</>
|
|
137
|
+
}
|
|
154
138
|
name="apiVip"
|
|
155
|
-
helperText={
|
|
139
|
+
helperText={ipHelperText}
|
|
156
140
|
value={values.apiVip || ''}
|
|
157
141
|
isValid={!apiVipFailedValidationMessage}
|
|
158
142
|
isRequired
|
|
@@ -165,9 +149,14 @@ export const VirtualIPControlGroup = ({
|
|
|
165
149
|
/>
|
|
166
150
|
</FormikStaticField>
|
|
167
151
|
<FormikStaticField
|
|
168
|
-
label={
|
|
152
|
+
label={
|
|
153
|
+
<>
|
|
154
|
+
<span>Ingress IP{ipFieldsSuffix}</span>{' '}
|
|
155
|
+
<PopoverIcon bodyContent={ipPopoverContent} />
|
|
156
|
+
</>
|
|
157
|
+
}
|
|
169
158
|
name="ingressVip"
|
|
170
|
-
helperText={
|
|
159
|
+
helperText={ipHelperText}
|
|
171
160
|
value={values.ingressVip || ''}
|
|
172
161
|
isValid={!ingressVipFailedValidationMessage}
|
|
173
162
|
isRequired
|
|
@@ -183,15 +172,24 @@ export const VirtualIPControlGroup = ({
|
|
|
183
172
|
) : (
|
|
184
173
|
<>
|
|
185
174
|
<OcmInputField
|
|
186
|
-
label={
|
|
175
|
+
label={
|
|
176
|
+
<>
|
|
177
|
+
<span>API IP{ipFieldsSuffix}</span> <PopoverIcon bodyContent={ipPopoverContent} />
|
|
178
|
+
</>
|
|
179
|
+
}
|
|
187
180
|
name="apiVip"
|
|
188
|
-
helperText={
|
|
181
|
+
helperText={ipHelperText}
|
|
189
182
|
isRequired
|
|
190
183
|
/>
|
|
191
184
|
<OcmInputField
|
|
192
185
|
name="ingressVip"
|
|
193
|
-
label={
|
|
194
|
-
|
|
186
|
+
label={
|
|
187
|
+
<>
|
|
188
|
+
<span>Ingress IP{ipFieldsSuffix}</span>{' '}
|
|
189
|
+
<PopoverIcon bodyContent={ipPopoverContent} />
|
|
190
|
+
</>
|
|
191
|
+
}
|
|
192
|
+
helperText={ipHelperText}
|
|
195
193
|
isRequired
|
|
196
194
|
/>
|
|
197
195
|
</>
|
|
@@ -20,7 +20,7 @@ const nutanixPlatformMessage =
|
|
|
20
20
|
'Enable Nutanix platform integration to access features like node auto-scaling directly inside OpenShift.';
|
|
21
21
|
|
|
22
22
|
const platformIntegrationTooltip =
|
|
23
|
-
'
|
|
23
|
+
'Virtualization platform integration is only applicable on non-SNO deployments and when all discovered hosts originated from the same platform.';
|
|
24
24
|
|
|
25
25
|
const messages: KeyType = {
|
|
26
26
|
'no-active-integrations': undeterminedPlatformMessage,
|
|
@@ -28,6 +28,7 @@ import { SentryErrorMonitorContextProvider } from '../SentryErrorMonitorContextP
|
|
|
28
28
|
import ClusterWizardContextProvider from '../clusterWizard/ClusterWizardContextProvider';
|
|
29
29
|
import { BackButton } from '../ui/Buttons/BackButton';
|
|
30
30
|
import { NewFeatureSupportLevelProvider } from '../newFeatureSupportLevels';
|
|
31
|
+
import { usePullSecret } from '../../hooks';
|
|
31
32
|
|
|
32
33
|
type AssistedInstallerDetailCardProps = {
|
|
33
34
|
aiClusterId: string;
|
|
@@ -90,12 +91,19 @@ const AssistedInstallerDetailCard = ({
|
|
|
90
91
|
permissions,
|
|
91
92
|
}: AssistedInstallerDetailCardProps) => {
|
|
92
93
|
const { cluster, uiState } = useClusterPolling(aiClusterId);
|
|
94
|
+
const pullSecret = usePullSecret();
|
|
93
95
|
const {
|
|
94
96
|
infraEnv,
|
|
95
97
|
isLoading: infraEnvLoading,
|
|
96
98
|
error: infraEnvError,
|
|
97
99
|
updateInfraEnv,
|
|
98
|
-
} = useInfraEnv(
|
|
100
|
+
} = useInfraEnv(
|
|
101
|
+
aiClusterId,
|
|
102
|
+
cluster?.cpuArchitecture ? (cluster.cpuArchitecture as CpuArchitecture) : CpuArchitecture.x86,
|
|
103
|
+
cluster?.name,
|
|
104
|
+
pullSecret,
|
|
105
|
+
cluster?.openshiftVersion,
|
|
106
|
+
);
|
|
99
107
|
if (uiState === ResourceUIState.LOADING || infraEnvLoading) {
|
|
100
108
|
return <LoadingCard />;
|
|
101
109
|
} else if ((uiState === ResourceUIState.POLLING_ERROR && !cluster) || infraEnvError) {
|
|
@@ -151,7 +159,9 @@ const AssistedInstallerDetailCard = ({
|
|
|
151
159
|
|
|
152
160
|
const Wrapper = (props: AssistedInstallerDetailCardProps) => (
|
|
153
161
|
<Provider store={store}>
|
|
154
|
-
<
|
|
162
|
+
<AlertsContextProvider>
|
|
163
|
+
<AssistedInstallerDetailCard {...props} />
|
|
164
|
+
</AlertsContextProvider>
|
|
155
165
|
</Provider>
|
|
156
166
|
);
|
|
157
167
|
|
|
@@ -14,6 +14,7 @@ import { selectCurrentClusterState } from '../../selectors';
|
|
|
14
14
|
import { Grid } from '@patternfly/react-core';
|
|
15
15
|
import { NewFeatureSupportLevelProvider } from '../newFeatureSupportLevels';
|
|
16
16
|
import useInfraEnv from '../../hooks/useInfraEnv';
|
|
17
|
+
import { usePullSecret } from '../../hooks';
|
|
17
18
|
|
|
18
19
|
type AssistedInstallerExtraDetailCardProps = {
|
|
19
20
|
allEnabledFeatures: FeatureListType;
|
|
@@ -23,9 +24,13 @@ const AssistedInstallerExtraDetailCard: React.FC<AssistedInstallerExtraDetailCar
|
|
|
23
24
|
allEnabledFeatures,
|
|
24
25
|
}) => {
|
|
25
26
|
const { data: cluster } = useSelector(selectCurrentClusterState);
|
|
27
|
+
const pullSecret = usePullSecret();
|
|
26
28
|
const { infraEnv } = useInfraEnv(
|
|
27
29
|
cluster?.id ? cluster?.id : '',
|
|
28
|
-
CpuArchitecture.
|
|
30
|
+
cluster?.cpuArchitecture ? (cluster.cpuArchitecture as CpuArchitecture) : CpuArchitecture.x86,
|
|
31
|
+
cluster?.name,
|
|
32
|
+
pullSecret,
|
|
33
|
+
cluster?.openshiftVersion,
|
|
29
34
|
);
|
|
30
35
|
|
|
31
36
|
if (!cluster || cluster.status === 'adding-hosts') {
|
|
@@ -52,7 +57,9 @@ const AssistedInstallerExtraDetailCard: React.FC<AssistedInstallerExtraDetailCar
|
|
|
52
57
|
|
|
53
58
|
const Wrapper: React.FC<AssistedInstallerExtraDetailCardProps> = (props) => (
|
|
54
59
|
<Provider store={store}>
|
|
55
|
-
<
|
|
60
|
+
<AlertsContextProvider>
|
|
61
|
+
<AssistedInstallerExtraDetailCard {...props} />
|
|
62
|
+
</AlertsContextProvider>
|
|
56
63
|
</Provider>
|
|
57
64
|
);
|
|
58
65
|
|
|
@@ -32,14 +32,15 @@ import ClusterPollingErrorModal from '../clusterDetail/ClusterPollingErrorModal'
|
|
|
32
32
|
import ClusterUpdateErrorModal from '../clusterDetail/ClusterUpdateErrorModal';
|
|
33
33
|
import { BackButton } from '../ui/Buttons/BackButton';
|
|
34
34
|
import { NewFeatureSupportLevelProvider } from '../newFeatureSupportLevels';
|
|
35
|
+
import { usePullSecret } from '../../hooks';
|
|
35
36
|
|
|
36
37
|
type MatchParams = {
|
|
37
38
|
clusterId: string;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs
|
|
41
|
+
const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs?: boolean }> = ({
|
|
41
42
|
clusterId,
|
|
42
|
-
showBreadcrumbs,
|
|
43
|
+
showBreadcrumbs = false,
|
|
43
44
|
}) => {
|
|
44
45
|
if (!clusterId) {
|
|
45
46
|
console.error('ClusterPageGeneric: missing clusterId');
|
|
@@ -47,12 +48,19 @@ const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs: boolean
|
|
|
47
48
|
const fetchCluster = useFetchCluster(clusterId);
|
|
48
49
|
const dispatch = useDispatch();
|
|
49
50
|
const { cluster, uiState, errorDetail } = useClusterPolling(clusterId);
|
|
51
|
+
const pullSecret = usePullSecret();
|
|
50
52
|
const {
|
|
51
53
|
infraEnv,
|
|
52
54
|
isLoading: infraEnvLoading,
|
|
53
55
|
error: infraEnvError,
|
|
54
56
|
updateInfraEnv,
|
|
55
|
-
} = useInfraEnv(
|
|
57
|
+
} = useInfraEnv(
|
|
58
|
+
clusterId,
|
|
59
|
+
cluster?.cpuArchitecture ? (cluster.cpuArchitecture as CpuArchitecture) : CpuArchitecture.x86,
|
|
60
|
+
cluster?.name,
|
|
61
|
+
pullSecret,
|
|
62
|
+
cluster?.openshiftVersion,
|
|
63
|
+
);
|
|
56
64
|
|
|
57
65
|
const getContent = (cluster: Cluster, infraEnv: InfraEnv) => {
|
|
58
66
|
if (cluster.status === 'adding-hosts') {
|
|
@@ -188,8 +196,12 @@ const ClusterPageGeneric: React.FC<{ clusterId: string; showBreadcrumbs: boolean
|
|
|
188
196
|
};
|
|
189
197
|
|
|
190
198
|
export const SingleClusterPage: React.FC<{ clusterId: string }> = ({ clusterId }) => (
|
|
191
|
-
<
|
|
199
|
+
<AlertsContextProvider>
|
|
200
|
+
<ClusterPageGeneric clusterId={clusterId} />
|
|
201
|
+
</AlertsContextProvider>
|
|
192
202
|
);
|
|
193
203
|
export const ClusterPage: React.FC<RouteComponentProps<MatchParams>> = ({ match }) => (
|
|
194
|
-
<
|
|
204
|
+
<AlertsContextProvider>
|
|
205
|
+
<ClusterPageGeneric clusterId={match.params.clusterId} showBreadcrumbs />
|
|
206
|
+
</AlertsContextProvider>
|
|
195
207
|
);
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { handleApiError } from '../../api';
|
|
18
18
|
import { FeatureSupportLevelsAPI } from '../../services/apis';
|
|
19
19
|
import { captureException } from '../../sentry';
|
|
20
|
-
import { useOpenshiftVersions } from '../../hooks';
|
|
20
|
+
import { useOpenshiftVersions, usePullSecret } from '../../hooks';
|
|
21
21
|
import { getFeatureDisabledReason, isFeatureSupported } from './featureStateUtils';
|
|
22
22
|
import useInfraEnv from '../../hooks/useInfraEnv';
|
|
23
23
|
import { isFeatureSupportedAndAvailable } from '../newFeatureSupportLevels/newFeatureStateUtils';
|
|
@@ -88,9 +88,13 @@ export const FeatureSupportLevelProvider: React.FC<SupportLevelProviderProps> =
|
|
|
88
88
|
loadingUi,
|
|
89
89
|
}) => {
|
|
90
90
|
const { loading: loadingOCPVersions, versions: versionOptions } = useOpenshiftVersions();
|
|
91
|
+
const pullSecret = usePullSecret();
|
|
91
92
|
const { infraEnv, isLoading: isInfraEnvLoading } = useInfraEnv(
|
|
92
93
|
cluster?.id || '',
|
|
93
|
-
CpuArchitecture.
|
|
94
|
+
cluster?.cpuArchitecture ? (cluster.cpuArchitecture as CpuArchitecture) : CpuArchitecture.x86,
|
|
95
|
+
cluster?.name,
|
|
96
|
+
pullSecret,
|
|
97
|
+
cluster?.openshiftVersion,
|
|
94
98
|
);
|
|
95
99
|
const fetcher = () => FeatureSupportLevelsAPI.list().then((res) => res.data);
|
|
96
100
|
const { data: featureSupportLevels, error } = useSWR<FeatureSupportLevels, unknown>(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
1
2
|
import { EventListFetchProps } from '../../../common';
|
|
2
3
|
import { handleApiError } from '../../api';
|
|
3
4
|
import { EventsAPI } from '../../services/apis';
|
|
@@ -8,11 +9,15 @@ export const onFetchEvents: EventListFetchProps['onFetchEvents'] = async (
|
|
|
8
9
|
onError,
|
|
9
10
|
) => {
|
|
10
11
|
try {
|
|
12
|
+
EventsAPI.abort();
|
|
11
13
|
const response = await EventsAPI.list(props);
|
|
12
14
|
onSuccess(response);
|
|
13
15
|
} catch (error) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const { code } = error as AxiosError;
|
|
17
|
+
if (!code || code !== 'ERR_CANCELED') {
|
|
18
|
+
handleApiError(error, () => {
|
|
19
|
+
onError('Failed to load events');
|
|
20
|
+
});
|
|
21
|
+
}
|
|
17
22
|
}
|
|
18
23
|
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
SupportLevel,
|
|
9
9
|
SupportLevels,
|
|
10
10
|
} from '../../../common';
|
|
11
|
-
import { useOpenshiftVersions } from '../../hooks';
|
|
11
|
+
import { useOpenshiftVersions, usePullSecret } from '../../hooks';
|
|
12
12
|
import {
|
|
13
13
|
getNewFeatureDisabledReason,
|
|
14
14
|
isFeatureSupportedAndAvailable,
|
|
@@ -42,9 +42,13 @@ export const NewFeatureSupportLevelProvider: React.FC<NewSupportLevelProviderPro
|
|
|
42
42
|
openshiftVersion,
|
|
43
43
|
}) => {
|
|
44
44
|
const { loading: loadingOCPVersions } = useOpenshiftVersions();
|
|
45
|
+
const pullSecret = usePullSecret();
|
|
45
46
|
const { infraEnv, isLoading: isInfraEnvLoading } = useInfraEnv(
|
|
46
47
|
cluster?.id || '',
|
|
47
|
-
CpuArchitecture.
|
|
48
|
+
cluster?.cpuArchitecture ? (cluster.cpuArchitecture as CpuArchitecture) : CpuArchitecture.x86,
|
|
49
|
+
cluster?.name,
|
|
50
|
+
pullSecret,
|
|
51
|
+
cluster?.openshiftVersion,
|
|
48
52
|
);
|
|
49
53
|
const featureSupportLevels = useSupportLevelsAPI('features', openshiftVersion, cpuArchitecture);
|
|
50
54
|
|
|
@@ -8,6 +8,9 @@ import InfraEnvIdsCacheService from '../services/InfraEnvIdsCacheService';
|
|
|
8
8
|
export default function useInfraEnv(
|
|
9
9
|
clusterId: Cluster['id'],
|
|
10
10
|
cpuArchitecture: CpuArchitecture,
|
|
11
|
+
clusterName?: string,
|
|
12
|
+
pullSecret?: string,
|
|
13
|
+
openshiftVersion?: string,
|
|
11
14
|
): {
|
|
12
15
|
infraEnv?: InfraEnv;
|
|
13
16
|
error?: string;
|
|
@@ -16,7 +19,13 @@ export default function useInfraEnv(
|
|
|
16
19
|
} {
|
|
17
20
|
const [infraEnv, setInfraEnv] = React.useState<InfraEnv>();
|
|
18
21
|
const [error, setError] = React.useState('');
|
|
19
|
-
const { infraEnvId, error: infraEnvIdError } = useInfraEnvId(
|
|
22
|
+
const { infraEnvId, error: infraEnvIdError } = useInfraEnvId(
|
|
23
|
+
clusterId,
|
|
24
|
+
cpuArchitecture,
|
|
25
|
+
clusterName,
|
|
26
|
+
pullSecret,
|
|
27
|
+
openshiftVersion,
|
|
28
|
+
);
|
|
20
29
|
|
|
21
30
|
const getInfraEnv = React.useCallback(async () => {
|
|
22
31
|
try {
|
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Cluster, CpuArchitecture, InfraEnv } from '../../common';
|
|
2
|
+
import { Cluster, ClusterCpuArchitecture, CpuArchitecture, InfraEnv } from '../../common';
|
|
3
3
|
import { getErrorMessage } from '../../common/utils';
|
|
4
4
|
import { InfraEnvsService } from '../services';
|
|
5
5
|
|
|
6
|
-
export default function useInfraEnvId(
|
|
6
|
+
export default function useInfraEnvId(
|
|
7
|
+
clusterId: Cluster['id'],
|
|
8
|
+
cpuArchitecture: CpuArchitecture,
|
|
9
|
+
clusterName?: string,
|
|
10
|
+
pullSecret?: string,
|
|
11
|
+
openshiftVersion?: string,
|
|
12
|
+
) {
|
|
7
13
|
const [infraEnvId, setInfraEnv] = React.useState<InfraEnv['id']>();
|
|
8
14
|
const [error, setError] = React.useState('');
|
|
9
15
|
|
|
10
16
|
const findInfraEnvId = React.useCallback(async () => {
|
|
11
17
|
try {
|
|
12
18
|
const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
|
|
13
|
-
|
|
19
|
+
if (infraEnvId && !(infraEnvId instanceof Error)) {
|
|
20
|
+
setInfraEnv(infraEnvId);
|
|
21
|
+
} else {
|
|
22
|
+
//If infraEnv doesn't exist create a new one
|
|
23
|
+
if (pullSecret) {
|
|
24
|
+
const infraEnv = await InfraEnvsService.create({
|
|
25
|
+
name: InfraEnvsService.makeInfraEnvName(cpuArchitecture, clusterName),
|
|
26
|
+
pullSecret,
|
|
27
|
+
clusterId: clusterId,
|
|
28
|
+
openshiftVersion,
|
|
29
|
+
cpuArchitecture: cpuArchitecture as ClusterCpuArchitecture,
|
|
30
|
+
});
|
|
31
|
+
setInfraEnv(infraEnv.id);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
14
34
|
} catch (e) {
|
|
15
35
|
setError(getErrorMessage(e));
|
|
16
36
|
}
|
|
17
|
-
}, [clusterId, cpuArchitecture]);
|
|
37
|
+
}, [clusterId, cpuArchitecture, clusterName, pullSecret, openshiftVersion]);
|
|
18
38
|
|
|
19
39
|
React.useEffect(() => {
|
|
20
40
|
if (!clusterId) {
|
|
@@ -14,7 +14,7 @@ export default function useInfraEnvImageUrl() {
|
|
|
14
14
|
async (clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture): Promise<ImgUrl> => {
|
|
15
15
|
try {
|
|
16
16
|
const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
|
|
17
|
-
if (!infraEnvId) {
|
|
17
|
+
if (!infraEnvId || infraEnvId instanceof Error) {
|
|
18
18
|
return { url: '', error: `Failed to retrieve the infraEnv for ${clusterId}` };
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -14,7 +14,7 @@ export default function useInfraEnvIpxeImageUrl() {
|
|
|
14
14
|
async (clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture): Promise<ImgUrl> => {
|
|
15
15
|
try {
|
|
16
16
|
const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
|
|
17
|
-
if (!infraEnvId) {
|
|
17
|
+
if (!infraEnvId || infraEnvId instanceof Error) {
|
|
18
18
|
return { url: '', error: `Failed to retrieve the infraEnv for ${clusterId}` };
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { InfraEnvsService } from '.';
|
|
2
2
|
import { ClustersAPI } from './apis';
|
|
3
|
-
import {
|
|
4
|
-
Cluster,
|
|
5
|
-
ClusterCpuArchitecture,
|
|
6
|
-
CpuArchitecture,
|
|
7
|
-
getSupportedCpuArchitectures,
|
|
8
|
-
OcmCpuArchitecture,
|
|
9
|
-
SupportedCpuArchitecture,
|
|
10
|
-
} from '../../common';
|
|
3
|
+
import { Cluster, ClusterCpuArchitecture, CpuArchitecture } from '../../common';
|
|
11
4
|
import { OcmClusterType } from '../components/AddHosts/types';
|
|
12
|
-
import {
|
|
13
|
-
mapOcmArchToCpuArchitecture,
|
|
14
|
-
mapClusterCpuArchToInfraEnvCpuArch,
|
|
15
|
-
} from './CpuArchitectureService';
|
|
5
|
+
import { mapOcmArchToCpuArchitecture } from './CpuArchitectureService';
|
|
16
6
|
|
|
17
7
|
export const getApiVipDnsName = (ocmCluster: OcmClusterType) => {
|
|
18
8
|
let apiVipDnsname = '';
|
|
@@ -44,13 +34,7 @@ const Day2ClusterService = {
|
|
|
44
34
|
return ocmCluster && ocmCluster.external_id;
|
|
45
35
|
},
|
|
46
36
|
|
|
47
|
-
async fetchCluster(
|
|
48
|
-
ocmCluster: OcmClusterType,
|
|
49
|
-
pullSecret: string,
|
|
50
|
-
openshiftVersion: string,
|
|
51
|
-
cpuArchitecturesByVersionImage: CpuArchitecture[],
|
|
52
|
-
canSelectCpuArch?: boolean,
|
|
53
|
-
) {
|
|
37
|
+
async fetchCluster(ocmCluster: OcmClusterType, pullSecret: string, openshiftVersion: string) {
|
|
54
38
|
const openshiftClusterId = Day2ClusterService.getOpenshiftClusterId(ocmCluster);
|
|
55
39
|
|
|
56
40
|
if (!openshiftClusterId) {
|
|
@@ -63,24 +47,13 @@ const Day2ClusterService = {
|
|
|
63
47
|
return Day2ClusterService.fetchClusterById(day2ClusterId);
|
|
64
48
|
}
|
|
65
49
|
|
|
66
|
-
// The first time the user accesses "Add hosts" tab, the infraEnv(s) need to be created
|
|
67
|
-
const createMultipleInfraEnvs =
|
|
68
|
-
ocmCluster.cpu_architecture === OcmCpuArchitecture.MULTI || canSelectCpuArch;
|
|
69
|
-
const cpuArchitectures = createMultipleInfraEnvs
|
|
70
|
-
? getSupportedCpuArchitectures(
|
|
71
|
-
canSelectCpuArch ? canSelectCpuArch : false,
|
|
72
|
-
cpuArchitecturesByVersionImage,
|
|
73
|
-
mapClusterCpuArchToInfraEnvCpuArch(ocmCluster.cpu_architecture),
|
|
74
|
-
)
|
|
75
|
-
: ([mapOcmArchToCpuArchitecture(ocmCluster.cpu_architecture)] as SupportedCpuArchitecture[]);
|
|
76
|
-
|
|
77
50
|
return Day2ClusterService.createCluster(
|
|
78
51
|
openshiftClusterId,
|
|
79
52
|
ocmCluster.display_name || ocmCluster.name || openshiftClusterId,
|
|
80
53
|
getApiVipDnsName(ocmCluster).apiVipDnsname,
|
|
81
54
|
pullSecret,
|
|
82
55
|
openshiftVersion,
|
|
83
|
-
|
|
56
|
+
mapOcmArchToCpuArchitecture(ocmCluster.cpu_architecture) as CpuArchitecture,
|
|
84
57
|
);
|
|
85
58
|
},
|
|
86
59
|
|
|
@@ -104,7 +77,7 @@ const Day2ClusterService = {
|
|
|
104
77
|
apiVipDnsname: string,
|
|
105
78
|
pullSecret: string,
|
|
106
79
|
openshiftVersion: string,
|
|
107
|
-
|
|
80
|
+
cpuArchitecture: CpuArchitecture,
|
|
108
81
|
) {
|
|
109
82
|
const { data: day2Cluster } = await ClustersAPI.registerAddHosts({
|
|
110
83
|
openshiftClusterId, // used to both match OpenShift Cluster and as an assisted-installer ID
|
|
@@ -113,17 +86,14 @@ const Day2ClusterService = {
|
|
|
113
86
|
openshiftVersion,
|
|
114
87
|
});
|
|
115
88
|
|
|
116
|
-
// Create the
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
cpuArchitecture: cpuArchitecture as ClusterCpuArchitecture,
|
|
124
|
-
});
|
|
89
|
+
// Create only the infraenv for the day1 cpu architecture
|
|
90
|
+
await InfraEnvsService.create({
|
|
91
|
+
name: InfraEnvsService.makeInfraEnvName(cpuArchitecture, day2Cluster.name),
|
|
92
|
+
pullSecret,
|
|
93
|
+
clusterId: day2Cluster.id,
|
|
94
|
+
openshiftVersion,
|
|
95
|
+
cpuArchitecture: cpuArchitecture as ClusterCpuArchitecture,
|
|
125
96
|
});
|
|
126
|
-
await Promise.all(infraEnvsToCreate);
|
|
127
97
|
|
|
128
98
|
return day2Cluster;
|
|
129
99
|
},
|
|
@@ -21,7 +21,7 @@ const read = (): InfraEnvCache => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
type InfraEnvStorage = Omit<Storage, 'getItem' | 'removeItem' | 'setItem'> & {
|
|
24
|
-
getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string |
|
|
24
|
+
getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string | Error;
|
|
25
25
|
removeInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): void;
|
|
26
26
|
removeInfraEnvs(clusterId: string): void;
|
|
27
27
|
updateInfraEnvs(clusterId: string, infraEnvs: InfraEnv[]): void;
|
|
@@ -42,18 +42,21 @@ const InfraEnvIdsCacheService: InfraEnvStorage = {
|
|
|
42
42
|
localStorage.removeItem(CACHE_KEY);
|
|
43
43
|
},
|
|
44
44
|
|
|
45
|
-
getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string |
|
|
45
|
+
getInfraEnvId(clusterId: string, cpuArchitecture: CpuArchitecture): string | Error {
|
|
46
46
|
if (!clusterId || !cpuArchitecture) {
|
|
47
|
-
return
|
|
47
|
+
return new Error(`clusterId or cpuArchitecture are missing`);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const cache = read();
|
|
51
51
|
const clusterInfraEnvs = cache[clusterId];
|
|
52
52
|
if (!clusterInfraEnvs) {
|
|
53
|
-
return
|
|
53
|
+
return new Error(`Not infraEnvs found for this cluster ${clusterId}`);
|
|
54
54
|
}
|
|
55
|
-
if (
|
|
56
|
-
|
|
55
|
+
if (
|
|
56
|
+
cpuArchitecture !== CpuArchitecture.USE_DAY1_ARCHITECTURE &&
|
|
57
|
+
cpuArchitecture !== CpuArchitecture.MULTI
|
|
58
|
+
) {
|
|
59
|
+
return clusterInfraEnvs[cpuArchitecture] || new Error(`InfraEnv can't be found`);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
const architectures = getAllCpuArchitectures().filter((arch) => {
|
|
@@ -11,9 +11,12 @@ import InfraEnvCache from './InfraEnvIdsCacheService';
|
|
|
11
11
|
import { getDummyInfraEnvField } from '../components/clusterConfiguration/staticIp/data/dummyData';
|
|
12
12
|
|
|
13
13
|
const InfraEnvsService = {
|
|
14
|
-
async getInfraEnvId(
|
|
14
|
+
async getInfraEnvId(
|
|
15
|
+
clusterId: Cluster['id'],
|
|
16
|
+
cpuArchitecture: CpuArchitecture,
|
|
17
|
+
): Promise<string | Error> {
|
|
15
18
|
let infraEnvId = InfraEnvCache.getInfraEnvId(clusterId, cpuArchitecture);
|
|
16
|
-
if (infraEnvId
|
|
19
|
+
if (infraEnvId instanceof Error) {
|
|
17
20
|
const { data: infraEnvs } = await InfraEnvsAPI.list(clusterId);
|
|
18
21
|
if (infraEnvs.length > 0) {
|
|
19
22
|
InfraEnvCache.updateInfraEnvs(clusterId, infraEnvs);
|
|
@@ -21,11 +24,6 @@ const InfraEnvsService = {
|
|
|
21
24
|
}
|
|
22
25
|
if (!infraEnvId) {
|
|
23
26
|
InfraEnvCache.removeInfraEnvId(clusterId, cpuArchitecture);
|
|
24
|
-
throw new Error(
|
|
25
|
-
`No InfraEnv could be found for clusterId: ${clusterId} and architecture ${
|
|
26
|
-
cpuArchitecture || ''
|
|
27
|
-
}`,
|
|
28
|
-
);
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
return infraEnvId;
|
|
@@ -33,15 +31,11 @@ const InfraEnvsService = {
|
|
|
33
31
|
|
|
34
32
|
async getInfraEnv(clusterId: Cluster['id'], cpuArchitecture: CpuArchitecture) {
|
|
35
33
|
const infraEnvId = await InfraEnvsService.getInfraEnvId(clusterId, cpuArchitecture);
|
|
36
|
-
if (infraEnvId) {
|
|
34
|
+
if (infraEnvId && !(infraEnvId instanceof Error)) {
|
|
37
35
|
const { data } = await InfraEnvsAPI.get(infraEnvId);
|
|
38
36
|
return data;
|
|
39
37
|
} else {
|
|
40
|
-
|
|
41
|
-
`No InfraEnv could be found for clusterId: ${clusterId} and architecture ${
|
|
42
|
-
cpuArchitecture || ''
|
|
43
|
-
}`,
|
|
44
|
-
);
|
|
38
|
+
return new Error(`Failed to retrieve the infraEnv for ${clusterId}`);
|
|
45
39
|
}
|
|
46
40
|
},
|
|
47
41
|
|
|
@@ -67,6 +61,7 @@ const InfraEnvsService = {
|
|
|
67
61
|
}
|
|
68
62
|
|
|
69
63
|
InfraEnvCache.updateInfraEnvs(params.clusterId, [infraEnv]);
|
|
64
|
+
return infraEnv;
|
|
70
65
|
},
|
|
71
66
|
|
|
72
67
|
async removeAll(clusterId: Cluster['id']) {
|
|
@@ -126,6 +121,10 @@ const InfraEnvsService = {
|
|
|
126
121
|
return updatedInfraEnv;
|
|
127
122
|
});
|
|
128
123
|
},
|
|
124
|
+
|
|
125
|
+
makeInfraEnvName(cpuArchitecture: string, name?: string) {
|
|
126
|
+
return `${name || ''}_infra-env-${cpuArchitecture}`;
|
|
127
|
+
},
|
|
129
128
|
};
|
|
130
129
|
|
|
131
130
|
export default InfraEnvsService;
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { EventList, V2Events } from '../../../common';
|
|
2
2
|
import { client } from '../../api';
|
|
3
3
|
|
|
4
|
+
let _getRequestAbortController = new AbortController();
|
|
5
|
+
|
|
4
6
|
const EventsAPI = {
|
|
5
7
|
makeBaseURI() {
|
|
6
8
|
return '/v2/events';
|
|
7
9
|
},
|
|
8
10
|
|
|
11
|
+
abort() {
|
|
12
|
+
_getRequestAbortController.abort();
|
|
13
|
+
/*
|
|
14
|
+
* The AbortController.signal can only be aborted once per instance.
|
|
15
|
+
* Therefore in order for other requests to be also abortable we need
|
|
16
|
+
* to create a new instance when this event occurs
|
|
17
|
+
*/
|
|
18
|
+
_getRequestAbortController = new AbortController();
|
|
19
|
+
},
|
|
20
|
+
|
|
9
21
|
createParams({
|
|
10
22
|
clusterId,
|
|
11
23
|
hostIds,
|
|
@@ -36,7 +48,9 @@ const EventsAPI = {
|
|
|
36
48
|
},
|
|
37
49
|
|
|
38
50
|
list(options: V2Events) {
|
|
39
|
-
return client.get<EventList>(`${EventsAPI.makeBaseURI()}${EventsAPI.createParams(options)}
|
|
51
|
+
return client.get<EventList>(`${EventsAPI.makeBaseURI()}${EventsAPI.createParams(options)}`, {
|
|
52
|
+
signal: _getRequestAbortController.signal,
|
|
53
|
+
});
|
|
40
54
|
},
|
|
41
55
|
};
|
|
42
56
|
|
package/package.json
CHANGED