@openshift-assisted/ui-lib 2.50.0 → 2.50.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.
- package/build/@types/common/api/assisted-service/ClustersAPI.d.ts +0 -4
- package/build/@types/common/api/assisted-service/ClustersAPI.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.d.ts.map +1 -1
- package/build/@types/common/components/ui/OpenShiftVersionModal.d.ts.map +1 -1
- package/build/@types/common/components/ui/formik/PullSecretField.d.ts.map +1 -1
- package/build/@types/common/config/constants.d.ts.map +1 -1
- package/build/@types/common/validationSchemas/addressValidation.d.ts.map +1 -1
- package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts +0 -5
- package/build/@types/common/validationSchemas/clusterDetailsValidation.d.ts.map +1 -1
- package/build/@types/ocm/components/Routes.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts +2 -2
- package/build/@types/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContext.d.ts +0 -9
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContext.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardFooter.d.ts +1 -2
- package/build/@types/ocm/components/clusterWizard/ClusterWizardFooter.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/NewClusterWizard.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/constants.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/disconnected/BasicStep.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/disconnected/ReviewStep.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/index.d.ts +0 -1
- package/build/@types/ocm/components/clusterWizard/index.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts +1 -1
- package/build/@types/ocm/components/clusterWizard/wizardTransition.d.ts.map +1 -1
- package/build/@types/ocm/services/ClustersService.d.ts +0 -4
- package/build/@types/ocm/services/ClustersService.d.ts.map +1 -1
- package/build/@types/ocm/services/InfraEnvsService.d.ts.map +1 -1
- package/build/cjs/common/api/assisted-service/ClustersAPI.js +0 -3
- package/build/cjs/common/api/assisted-service/ClustersAPI.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +8 -17
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js +2 -2
- package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js.map +1 -1
- package/build/cjs/common/components/ui/OpenShiftVersionModal.js +1 -3
- package/build/cjs/common/components/ui/OpenShiftVersionModal.js.map +1 -1
- package/build/cjs/common/components/ui/WizardFooter.js +1 -1
- package/build/cjs/common/components/ui/WizardFooter.js.map +1 -1
- package/build/cjs/common/components/ui/formik/PullSecretField.js.map +1 -1
- package/build/cjs/common/config/constants.js +0 -1
- package/build/cjs/common/config/constants.js.map +1 -1
- package/build/cjs/common/validationSchemas/addressValidation.js +16 -4
- package/build/cjs/common/validationSchemas/addressValidation.js.map +1 -1
- package/build/cjs/common/validationSchemas/clusterDetailsValidation.js +2 -31
- package/build/cjs/common/validationSchemas/clusterDetailsValidation.js.map +1 -1
- package/build/cjs/ocm/components/Routes.js +1 -2
- package/build/cjs/ocm/components/Routes.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js +0 -1
- package/build/cjs/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +5 -2
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContext.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js +9 -69
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js +6 -21
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardFooter.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js +1 -11
- package/build/cjs/ocm/components/clusterWizard/NewClusterWizard.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/constants.js +0 -1
- package/build/cjs/ocm/components/clusterWizard/constants.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js +18 -96
- package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js +6 -10
- package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/index.js +1 -3
- package/build/cjs/ocm/components/clusterWizard/index.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/wizardTransition.js +0 -3
- package/build/cjs/ocm/components/clusterWizard/wizardTransition.js.map +1 -1
- package/build/cjs/ocm/hooks/useInfraEnvId.js +2 -2
- package/build/cjs/ocm/hooks/useInfraEnvId.js.map +1 -1
- package/build/cjs/ocm/services/ClustersService.js +0 -6
- package/build/cjs/ocm/services/ClustersService.js.map +1 -1
- package/build/cjs/ocm/services/InfraEnvsService.js +1 -4
- package/build/cjs/ocm/services/InfraEnvsService.js.map +1 -1
- package/lib/common/api/assisted-service/ClustersAPI.ts +0 -6
- package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +9 -19
- package/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx +0 -2
- package/lib/common/components/ui/OpenShiftVersionModal.tsx +1 -3
- package/lib/common/components/ui/WizardFooter.tsx +1 -1
- package/lib/common/components/ui/formik/PullSecretField.tsx +0 -1
- package/lib/common/config/constants.ts +0 -1
- package/lib/common/validationSchemas/addressValidation.tsx +16 -11
- package/lib/common/validationSchemas/clusterDetailsValidation.tsx +15 -47
- package/lib/ocm/components/Routes.tsx +1 -3
- package/lib/ocm/components/clusterConfiguration/DiscoveryImageTypeDropdown.tsx +0 -1
- package/lib/ocm/components/clusterConfiguration/OcmDiscoveryImageConfigForm.tsx +3 -2
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +6 -3
- package/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx +0 -9
- package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +24 -106
- package/lib/ocm/components/clusterWizard/ClusterWizardFooter.tsx +5 -26
- package/lib/ocm/components/clusterWizard/NewClusterWizard.tsx +3 -14
- package/lib/ocm/components/clusterWizard/constants.ts +0 -1
- package/lib/ocm/components/clusterWizard/disconnected/BasicStep.tsx +37 -138
- package/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx +8 -18
- package/lib/ocm/components/clusterWizard/index.ts +0 -1
- package/lib/ocm/components/clusterWizard/wizardTransition.ts +1 -5
- package/lib/ocm/hooks/useInfraEnvId.ts +2 -2
- package/lib/ocm/services/ClustersService.ts +0 -6
- package/lib/ocm/services/InfraEnvsService.ts +1 -4
- package/package.json +3 -3
- package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts +0 -4
- package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts.map +0 -1
- package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts +0 -4
- package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts.map +0 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js +0 -48
- package/build/cjs/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.js.map +0 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js +0 -204
- package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js.map +0 -1
- package/lib/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.tsx +0 -78
- package/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx +0 -402
|
@@ -7,162 +7,61 @@ import {
|
|
|
7
7
|
StaticTextField,
|
|
8
8
|
useTranslation,
|
|
9
9
|
} from '../../../../common';
|
|
10
|
-
import { Flex, Grid, GridItem, Form, Content
|
|
10
|
+
import { Flex, Grid, GridItem, Form, Content } from '@patternfly/react-core';
|
|
11
11
|
import OcmOpenShiftVersion from '../../clusterConfiguration/OcmOpenShiftVersion';
|
|
12
12
|
import { useClusterWizardContext } from '../ClusterWizardContext';
|
|
13
13
|
import ClusterWizardFooter from '../ClusterWizardFooter';
|
|
14
14
|
import ClusterWizardNavigation from '../ClusterWizardNavigation';
|
|
15
15
|
import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary';
|
|
16
16
|
import InstallDisconnectedSwitch from './InstallDisconnectedSwitch';
|
|
17
|
-
import { Formik
|
|
18
|
-
import ClustersService from '../../../services/ClustersService';
|
|
19
|
-
import { handleApiError, getApiErrorMessage } from '../../../../common/api';
|
|
20
|
-
import { useAlerts } from '../../../../common/components/AlertsContextProvider';
|
|
21
|
-
import { AlertVariant } from '@patternfly/react-core';
|
|
22
|
-
import { ClusterWizardFlowStateNew } from '../wizardTransition';
|
|
23
|
-
import { useLocation, useNavigate, useParams } from 'react-router-dom-v5-compat';
|
|
24
|
-
import { AxiosResponse } from 'axios';
|
|
25
|
-
import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
|
|
26
|
-
import OcmOpenShiftVersionSelect from '../../clusterConfiguration/OcmOpenShiftVersionSelect';
|
|
17
|
+
import { Formik } from 'formik';
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
openshiftVersion: string;
|
|
30
|
-
customOpenshiftSelect: string | null;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const BasicStepForm = () => {
|
|
34
|
-
const { clusterId } = useParams<{ clusterId: string }>();
|
|
35
|
-
const [isLoading, setIsLoading] = React.useState(true);
|
|
36
|
-
const [cluster, setCluster] = React.useState<Cluster>();
|
|
37
|
-
|
|
38
|
-
const { values } = useFormikContext<BasicStepFormikValues>();
|
|
19
|
+
const BasicStep = () => {
|
|
39
20
|
const { t } = useTranslation();
|
|
40
21
|
const { moveNext } = useClusterWizardContext();
|
|
41
|
-
const { addAlert } = useAlerts();
|
|
42
|
-
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
43
|
-
const navigate = useNavigate();
|
|
44
|
-
const location = useLocation();
|
|
45
|
-
const currentPath = location.pathname;
|
|
46
|
-
|
|
47
|
-
React.useEffect(() => {
|
|
48
|
-
if (!clusterId) {
|
|
49
|
-
setIsLoading(false);
|
|
50
|
-
} else {
|
|
51
|
-
void (async () => {
|
|
52
|
-
setIsLoading(true);
|
|
53
|
-
try {
|
|
54
|
-
setCluster(await ClustersService.get(clusterId));
|
|
55
|
-
} catch (error) {
|
|
56
|
-
handleApiError(error, () => {
|
|
57
|
-
addAlert({
|
|
58
|
-
title: 'Failed to fetch disconnected cluster',
|
|
59
|
-
message: getApiErrorMessage(error),
|
|
60
|
-
variant: AlertVariant.danger,
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
} finally {
|
|
64
|
-
setIsLoading(false);
|
|
65
|
-
}
|
|
66
|
-
})();
|
|
67
|
-
}
|
|
68
|
-
}, [clusterId, addAlert]);
|
|
69
|
-
|
|
70
|
-
const createCluster = async () => {
|
|
71
|
-
try {
|
|
72
|
-
setIsSubmitting(true);
|
|
73
|
-
// Create cluster only - infraEnv will be created in OptionalConfigurationsStep
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
75
|
-
const { data: disconnectedCluster }: AxiosResponse<Cluster> =
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
77
|
-
await ClustersService.registerDisconnected({
|
|
78
|
-
name: 'disconnected-cluster',
|
|
79
|
-
openshiftVersion: values.openshiftVersion,
|
|
80
|
-
});
|
|
81
|
-
navigate(`${currentPath}/${disconnectedCluster.id}`, {
|
|
82
|
-
state: ClusterWizardFlowStateNew,
|
|
83
|
-
});
|
|
84
|
-
moveNext();
|
|
85
|
-
} catch (error: unknown) {
|
|
86
|
-
handleApiError(error, () => {
|
|
87
|
-
addAlert({
|
|
88
|
-
title: 'Failed to create disconnected cluster',
|
|
89
|
-
message: getApiErrorMessage(error),
|
|
90
|
-
variant: AlertVariant.danger,
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
} finally {
|
|
94
|
-
setIsSubmitting(false);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
22
|
|
|
98
23
|
return (
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
clusterId ? moveNext() : void createCluster();
|
|
105
|
-
}}
|
|
106
|
-
isSubmitting={isSubmitting}
|
|
107
|
-
isNextDisabled={isLoading || (cluster ? false : !values.openshiftVersion)}
|
|
108
|
-
disconnectedClusterId={clusterId}
|
|
109
|
-
/>
|
|
110
|
-
}
|
|
24
|
+
<Formik
|
|
25
|
+
initialValues={{}}
|
|
26
|
+
onSubmit={() => {
|
|
27
|
+
// nothing to do
|
|
28
|
+
}}
|
|
111
29
|
>
|
|
112
|
-
<
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
>
|
|
30
|
+
<ClusterWizardStep
|
|
31
|
+
navigation={<ClusterWizardNavigation />}
|
|
32
|
+
footer={<ClusterWizardFooter onNext={moveNext} />}
|
|
33
|
+
>
|
|
34
|
+
<WithErrorBoundary title="Failed to load Basic step">
|
|
35
|
+
<Grid hasGutter>
|
|
36
|
+
<GridItem>
|
|
37
|
+
<Content component="h2">Basic information</Content>
|
|
38
|
+
</GridItem>
|
|
39
|
+
<GridItem>
|
|
40
|
+
<Flex alignItems={{ default: 'alignItemsCenter' }} gap={{ default: 'gapSm' }}>
|
|
41
|
+
<TechnologyPreview />
|
|
42
|
+
<InstallDisconnectedSwitch />
|
|
43
|
+
<span>
|
|
44
|
+
{t("ai:I'm installing on a disconnected/air-gapped/secured environment")}
|
|
45
|
+
</span>
|
|
46
|
+
</Flex>
|
|
47
|
+
</GridItem>
|
|
48
|
+
<GridItem>
|
|
49
|
+
<Form id="wizard-cluster-basic-info__form">
|
|
50
|
+
<OcmOpenShiftVersion openshiftVersion="4.20" withPreviewText withMultiText>
|
|
134
51
|
<ExternalLink href={`${window.location.origin}/${OCP_RELEASES_PAGE}`}>
|
|
135
52
|
<span data-ouia-id="openshift-releases-link">
|
|
136
53
|
{t('ai:Learn more about OpenShift releases')}
|
|
137
54
|
</span>
|
|
138
55
|
</ExternalLink>
|
|
139
56
|
</OcmOpenShiftVersion>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
</Grid>
|
|
149
|
-
</WithErrorBoundary>
|
|
150
|
-
</ClusterWizardStep>
|
|
151
|
-
);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const BasicStep = () => {
|
|
155
|
-
return (
|
|
156
|
-
<Formik<BasicStepFormikValues>
|
|
157
|
-
initialValues={{
|
|
158
|
-
openshiftVersion: '',
|
|
159
|
-
customOpenshiftSelect: null,
|
|
160
|
-
}}
|
|
161
|
-
onSubmit={() => {
|
|
162
|
-
// nothing to do
|
|
163
|
-
}}
|
|
164
|
-
>
|
|
165
|
-
<BasicStepForm />
|
|
57
|
+
<StaticTextField name="cpuArchitecture" label="CPU architecture" isRequired>
|
|
58
|
+
x86_64
|
|
59
|
+
</StaticTextField>
|
|
60
|
+
</Form>
|
|
61
|
+
</GridItem>
|
|
62
|
+
</Grid>
|
|
63
|
+
</WithErrorBoundary>
|
|
64
|
+
</ClusterWizardStep>
|
|
166
65
|
</Formik>
|
|
167
66
|
);
|
|
168
67
|
};
|
|
@@ -25,13 +25,16 @@ import {
|
|
|
25
25
|
Content,
|
|
26
26
|
} from '@patternfly/react-core';
|
|
27
27
|
import { Formik } from 'formik';
|
|
28
|
-
import {
|
|
28
|
+
import { saveAs } from 'file-saver';
|
|
29
|
+
import { useNavigate } from 'react-router-dom-v5-compat';
|
|
29
30
|
|
|
30
31
|
import { getOperatorSpecs } from '../../../../common/components/operators/operatorSpecs';
|
|
31
32
|
|
|
33
|
+
const downloadUrl =
|
|
34
|
+
'https://mirror.openshift.com/pub/cgw/assisted-installer-disconnected/latest/agent-ove.x86_64.iso';
|
|
35
|
+
|
|
32
36
|
const ReviewStep = () => {
|
|
33
|
-
const { moveBack
|
|
34
|
-
const { clusterId } = useParams<{ clusterId: string }>();
|
|
37
|
+
const { moveBack } = useClusterWizardContext();
|
|
35
38
|
const opSpecs = getOperatorSpecs(() => undefined);
|
|
36
39
|
const navigate = useNavigate();
|
|
37
40
|
|
|
@@ -47,14 +50,11 @@ const ReviewStep = () => {
|
|
|
47
50
|
footer={
|
|
48
51
|
<ClusterWizardFooter
|
|
49
52
|
onNext={() => {
|
|
50
|
-
|
|
51
|
-
window.open(disconnectedInfraEnv.downloadUrl, '_blank');
|
|
52
|
-
}
|
|
53
|
+
downloadUrl && saveAs(downloadUrl);
|
|
53
54
|
navigate('/cluster-list');
|
|
54
55
|
}}
|
|
55
56
|
onBack={moveBack}
|
|
56
57
|
nextButtonText="Download ISO"
|
|
57
|
-
disconnectedClusterId={clusterId}
|
|
58
58
|
/>
|
|
59
59
|
}
|
|
60
60
|
>
|
|
@@ -96,19 +96,9 @@ const ReviewStep = () => {
|
|
|
96
96
|
</List>
|
|
97
97
|
</Alert>
|
|
98
98
|
<DescriptionList isHorizontal>
|
|
99
|
-
{disconnectedInfraEnv?.rendezvousIp && (
|
|
100
|
-
<DescriptionListGroup>
|
|
101
|
-
<DescriptionListTerm>Rendezvous IP</DescriptionListTerm>
|
|
102
|
-
<DescriptionListDescription>
|
|
103
|
-
{disconnectedInfraEnv?.rendezvousIp}
|
|
104
|
-
</DescriptionListDescription>
|
|
105
|
-
</DescriptionListGroup>
|
|
106
|
-
)}
|
|
107
99
|
<DescriptionListGroup>
|
|
108
100
|
<DescriptionListTerm>OpenShift version</DescriptionListTerm>
|
|
109
|
-
<DescriptionListDescription>
|
|
110
|
-
{disconnectedInfraEnv?.openshiftVersion || ''}
|
|
111
|
-
</DescriptionListDescription>
|
|
101
|
+
<DescriptionListDescription>4.20</DescriptionListDescription>
|
|
112
102
|
</DescriptionListGroup>
|
|
113
103
|
<DescriptionListGroup>
|
|
114
104
|
<DescriptionListTerm>CPU architecture</DescriptionListTerm>
|
|
@@ -2,5 +2,4 @@ export { default as ClusterDetailsForm } from './ClusterDetailsForm';
|
|
|
2
2
|
export { default as NewClusterWizard } from './NewClusterWizard';
|
|
3
3
|
export { default as ClusterWizard } from './ClusterWizard';
|
|
4
4
|
export { default as ClusterWizardContextProvider } from './ClusterWizardContextProvider';
|
|
5
|
-
export { useClusterWizardContext } from './ClusterWizardContext';
|
|
6
5
|
export { OpenShiftVersionsContextProvider } from './OpenShiftVersionsContext';
|
|
@@ -31,8 +31,7 @@ export type ClusterWizardStepsType =
|
|
|
31
31
|
| 'custom-manifests'
|
|
32
32
|
| 'credentials-download'
|
|
33
33
|
| 'disconnected-basic'
|
|
34
|
-
| 'disconnected-review'
|
|
35
|
-
| 'disconnected-optional-configurations';
|
|
34
|
+
| 'disconnected-review';
|
|
36
35
|
|
|
37
36
|
const wizardStepsOrder: ClusterWizardStepsType[] = [
|
|
38
37
|
'cluster-details',
|
|
@@ -50,7 +49,6 @@ const wizardStepsOrder: ClusterWizardStepsType[] = [
|
|
|
50
49
|
|
|
51
50
|
export const disconnectedSteps: ClusterWizardStepsType[] = [
|
|
52
51
|
'disconnected-basic',
|
|
53
|
-
'disconnected-optional-configurations',
|
|
54
52
|
'disconnected-review',
|
|
55
53
|
];
|
|
56
54
|
|
|
@@ -262,7 +260,6 @@ const credentialsValidationMap = buildEmptyValidationsMap();
|
|
|
262
260
|
const customManifestsValidationsMap = buildEmptyValidationsMap();
|
|
263
261
|
const disconnectedReviewValidationsMap = buildEmptyValidationsMap();
|
|
264
262
|
const disconnectedBasicValidationsMap = buildEmptyValidationsMap();
|
|
265
|
-
const disconnectedOptionalConfigurationsValidationsMap = buildEmptyValidationsMap();
|
|
266
263
|
|
|
267
264
|
export const wizardStepsValidationsMap: WizardStepsValidationMap<ClusterWizardStepsType> = {
|
|
268
265
|
'cluster-details': clusterDetailsStepValidationsMap,
|
|
@@ -278,7 +275,6 @@ export const wizardStepsValidationsMap: WizardStepsValidationMap<ClusterWizardSt
|
|
|
278
275
|
'credentials-download': credentialsValidationMap,
|
|
279
276
|
'disconnected-review': disconnectedReviewValidationsMap,
|
|
280
277
|
'disconnected-basic': disconnectedBasicValidationsMap,
|
|
281
|
-
'disconnected-optional-configurations': disconnectedOptionalConfigurationsValidationsMap,
|
|
282
278
|
};
|
|
283
279
|
|
|
284
280
|
export const allClusterWizardSoftValidationIds =
|
|
@@ -55,12 +55,12 @@ export default function useInfraEnvId(
|
|
|
55
55
|
]);
|
|
56
56
|
|
|
57
57
|
React.useEffect(() => {
|
|
58
|
-
if (!clusterId
|
|
58
|
+
if (!clusterId) {
|
|
59
59
|
setError('Missing clusterId to load infrastructure environment');
|
|
60
60
|
} else if (!infraEnvId) {
|
|
61
61
|
void findInfraEnvId();
|
|
62
62
|
}
|
|
63
|
-
}, [clusterId, findInfraEnvId, infraEnvId
|
|
63
|
+
}, [clusterId, findInfraEnvId, infraEnvId]);
|
|
64
64
|
|
|
65
65
|
return { infraEnvId, error };
|
|
66
66
|
}
|
|
@@ -171,11 +171,5 @@ const ClustersService = {
|
|
|
171
171
|
this.getUpdateManifestParams(existingManifest, updatedManifest),
|
|
172
172
|
);
|
|
173
173
|
},
|
|
174
|
-
registerDisconnected(params: { name: string; openshiftVersion: string }) {
|
|
175
|
-
return ClustersAPI.registerDisconnected({
|
|
176
|
-
name: params.name,
|
|
177
|
-
openshiftVersion: params.openshiftVersion,
|
|
178
|
-
});
|
|
179
|
-
},
|
|
180
174
|
};
|
|
181
175
|
export default ClustersService;
|
|
@@ -21,10 +21,7 @@ const InfraEnvsService = {
|
|
|
21
21
|
const { data: infraEnvs } = await InfraEnvsAPI.list(
|
|
22
22
|
!isSingleClusterFeatureEnabled ? clusterId : '',
|
|
23
23
|
);
|
|
24
|
-
if (
|
|
25
|
-
return infraEnvs[0].id;
|
|
26
|
-
}
|
|
27
|
-
if (infraEnvs.length > 0 && clusterId) {
|
|
24
|
+
if (infraEnvs.length > 0) {
|
|
28
25
|
InfraEnvCache.updateInfraEnvs(clusterId, infraEnvs);
|
|
29
26
|
infraEnvId = InfraEnvCache.getInfraEnvId(clusterId, cpuArchitecture);
|
|
30
27
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@openshift-assisted/locales": "2.50.
|
|
4
|
-
"@openshift-assisted/types": "2.50.
|
|
3
|
+
"@openshift-assisted/locales": "2.50.1",
|
|
4
|
+
"@openshift-assisted/types": "2.50.1",
|
|
5
5
|
"@openshift-console/dynamic-plugin-sdk": "1.0.0",
|
|
6
6
|
"@patternfly/patternfly": "6.4.0",
|
|
7
7
|
"@patternfly/react-code-editor": "6.4.0",
|
|
@@ -136,5 +136,5 @@
|
|
|
136
136
|
]
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
|
-
"version": "2.50.
|
|
139
|
+
"version": "2.50.1"
|
|
140
140
|
}
|
package/build/@types/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisconnectedStaticIp.d.ts","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsB1B,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAqDjC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
package/build/@types/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionalConfigurationsStep.d.ts","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4K/B,QAAA,MAAM,0BAA0B,yBAmO/B,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const common_1 = require("../../../../common");
|
|
6
|
-
const ClusterWizardContext_1 = require("../ClusterWizardContext");
|
|
7
|
-
const ClusterWizardFooter_1 = tslib_1.__importDefault(require("../ClusterWizardFooter"));
|
|
8
|
-
const ClusterWizardNavigation_1 = tslib_1.__importDefault(require("../ClusterWizardNavigation"));
|
|
9
|
-
const StaticIpPage_1 = require("../../clusterConfiguration/staticIp/components/StaticIpPage");
|
|
10
|
-
const WithErrorBoundary_1 = require("../../../../common/components/ErrorHandling/WithErrorBoundary");
|
|
11
|
-
const apis_1 = require("../../../services/apis");
|
|
12
|
-
const getInitialFormStateProps = () => {
|
|
13
|
-
return {
|
|
14
|
-
isValid: true,
|
|
15
|
-
isSubmitting: false,
|
|
16
|
-
isAutoSaveRunning: false,
|
|
17
|
-
errors: {},
|
|
18
|
-
touched: {},
|
|
19
|
-
isEmpty: true,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
const DisconnectedStaticIp = () => {
|
|
23
|
-
const { moveNext, moveBack, disconnectedInfraEnv, setDisconnectedInfraEnv } = (0, ClusterWizardContext_1.useClusterWizardContext)();
|
|
24
|
-
const { alerts } = (0, common_1.useAlerts)();
|
|
25
|
-
const [formState, setFormStateProps] = react_1.default.useState(getInitialFormStateProps());
|
|
26
|
-
const onFormStateChange = (formState) => {
|
|
27
|
-
setFormStateProps(formState);
|
|
28
|
-
};
|
|
29
|
-
const updateInfraEnv = (params) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
-
if (!(disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id)) {
|
|
31
|
-
throw new Error('No disconnected infraEnv available');
|
|
32
|
-
}
|
|
33
|
-
const { data: updatedInfraEnv } = yield apis_1.InfraEnvsAPI.update(disconnectedInfraEnv.id, params);
|
|
34
|
-
setDisconnectedInfraEnv(updatedInfraEnv);
|
|
35
|
-
return updatedInfraEnv;
|
|
36
|
-
});
|
|
37
|
-
const isNextDisabled = formState.isAutoSaveRunning || !formState.isValid || !!alerts.length || formState.isSubmitting;
|
|
38
|
-
const errorFields = (0, common_1.getFormikErrorFields)(formState.errors, formState.touched);
|
|
39
|
-
const footer = (react_1.default.createElement(ClusterWizardFooter_1.default, { alertTitle: "Static IP configuration contains missing or invalid fields", alertContent: null, errorFields: errorFields, isSubmitting: formState.isSubmitting, onNext: () => moveNext(), onBack: () => moveBack(), isNextDisabled: isNextDisabled, isBackDisabled: formState.isSubmitting || formState.isAutoSaveRunning }));
|
|
40
|
-
if (!disconnectedInfraEnv) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
return (react_1.default.createElement(common_1.ClusterWizardStep, { navigation: react_1.default.createElement(ClusterWizardNavigation_1.default, null), footer: footer },
|
|
44
|
-
react_1.default.createElement(WithErrorBoundary_1.WithErrorBoundary, { title: "Failed to load Static IP step" },
|
|
45
|
-
react_1.default.createElement(StaticIpPage_1.StaticIpPage, { infraEnv: disconnectedInfraEnv, updateInfraEnv: updateInfraEnv, onFormStateChange: onFormStateChange }))));
|
|
46
|
-
};
|
|
47
|
-
exports.default = DisconnectedStaticIp;
|
|
48
|
-
//# sourceMappingURL=DisconnectedStaticIp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisconnectedStaticIp.js","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterWizard/disconnected/DisconnectedStaticIp.tsx"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,+CAAwF;AACxF,kEAAkE;AAClE,yFAAyD;AACzD,iGAAiE;AAEjE,8FAA2F;AAC3F,qGAAkG;AAClG,iDAAsD;AAGtD,MAAM,wBAAwB,GAAG,GAAsB,EAAE;IACvD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,KAAK;QACnB,iBAAiB,EAAE,KAAK;QACxB,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAa,GAAG,EAAE;IAC1C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,GACzE,IAAA,8CAAuB,GAAE,CAAC;IAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC/B,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAAC,GAAG,eAAK,CAAC,QAAQ,CACnD,wBAAwB,EAAE,CAC3B,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,SAA4B,EAAE,EAAE;QACzD,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAO,MAA4B,EAAE,EAAE;QAC5D,IAAI,CAAC,CAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,EAAE,CAAA,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,mBAAY,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7F,uBAAuB,CAAC,eAAe,CAAC,CAAC;QACzC,OAAO,eAAe,CAAC;IACzB,CAAC,CAAA,CAAC;IAEF,MAAM,cAAc,GAClB,SAAS,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,YAAY,CAAC;IACjG,MAAM,WAAW,GAAG,IAAA,6BAAoB,EAAS,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAEtF,MAAM,MAAM,GAAG,CACb,8BAAC,6BAAmB,IAClB,UAAU,EAAC,4DAA4D,EACvE,YAAY,EAAE,IAAI,EAClB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,SAAS,CAAC,YAAY,EACpC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EACxB,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,EACxB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,SAAS,CAAC,YAAY,IAAI,SAAS,CAAC,iBAAiB,GACrE,CACH,CAAC;IAEF,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,8BAAC,0BAAiB,IAAC,UAAU,EAAE,8BAAC,iCAAuB,OAAG,EAAE,MAAM,EAAE,MAAM;QACxE,8BAAC,qCAAiB,IAAC,KAAK,EAAC,+BAA+B;YACtD,8BAAC,2BAAY,IACX,QAAQ,EAAE,oBAAoB,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,GACpC,CACgB,CACF,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const React = tslib_1.__importStar(require("react"));
|
|
5
|
-
const formik_1 = require("formik");
|
|
6
|
-
const Yup = tslib_1.__importStar(require("yup"));
|
|
7
|
-
const common_1 = require("../../../../common");
|
|
8
|
-
const react_core_1 = require("@patternfly/react-core");
|
|
9
|
-
const ClusterWizardContext_1 = require("../ClusterWizardContext");
|
|
10
|
-
const ClusterWizardFooter_1 = tslib_1.__importDefault(require("../ClusterWizardFooter"));
|
|
11
|
-
const ClusterWizardNavigation_1 = tslib_1.__importDefault(require("../ClusterWizardNavigation"));
|
|
12
|
-
const WithErrorBoundary_1 = require("../../../../common/components/ErrorHandling/WithErrorBoundary");
|
|
13
|
-
const UploadSSH_1 = tslib_1.__importDefault(require("../../../../common/components/clusterConfiguration/UploadSSH"));
|
|
14
|
-
const PullSecretField_1 = tslib_1.__importDefault(require("../../../../common/components/ui/formik/PullSecretField"));
|
|
15
|
-
const ProxyFields_1 = require("../../../../common/components/clusterConfiguration/ProxyFields");
|
|
16
|
-
const api_1 = require("../../../../common/api");
|
|
17
|
-
const AlertsContextProvider_1 = require("../../../../common/components/AlertsContextProvider");
|
|
18
|
-
const react_core_2 = require("@patternfly/react-core");
|
|
19
|
-
const InfraEnvsService_1 = tslib_1.__importDefault(require("../../../services/InfraEnvsService"));
|
|
20
|
-
const apis_1 = require("../../../services/apis");
|
|
21
|
-
const usePullSecret_1 = tslib_1.__importDefault(require("../../../hooks/usePullSecret"));
|
|
22
|
-
const react_router_dom_v5_compat_1 = require("react-router-dom-v5-compat");
|
|
23
|
-
const ClustersService_1 = tslib_1.__importDefault(require("../../../services/ClustersService"));
|
|
24
|
-
const HostsNetworkConfigurationControlGroup_1 = require("../../clusterConfiguration/HostsNetworkConfigurationControlGroup");
|
|
25
|
-
const types_1 = require("../../../services/types");
|
|
26
|
-
const use_translation_wrapper_1 = require("../../../../common/hooks/use-translation-wrapper");
|
|
27
|
-
const dummyData_1 = require("../../clusterConfiguration/staticIp/data/dummyData");
|
|
28
|
-
const ntpValidation_1 = require("../../../../common/validationSchemas/ntpValidation");
|
|
29
|
-
const DEFAULT_CPU_ARCHITECTURE = 'x86_64';
|
|
30
|
-
const DISCONNECTED_IMAGE_TYPE = 'disconnected-iso';
|
|
31
|
-
const DEFAULT_INITIAL_VALUES = {
|
|
32
|
-
sshPublicKey: '',
|
|
33
|
-
pullSecret: '',
|
|
34
|
-
enableProxy: false,
|
|
35
|
-
httpProxy: '',
|
|
36
|
-
httpsProxy: '',
|
|
37
|
-
noProxy: '',
|
|
38
|
-
enableNtpSources: false,
|
|
39
|
-
additionalNtpSources: '',
|
|
40
|
-
hostsNetworkConfigurationType: types_1.HostsNetworkConfigurationType.DHCP,
|
|
41
|
-
rendezvousIp: '',
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Rehydrate form values from infraEnv and optional stored pull secret (API does not return pull secret).
|
|
45
|
-
*/
|
|
46
|
-
const infraEnvToFormValues = (infraEnv, storedPullSecret) => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
48
|
-
return (Object.assign(Object.assign({}, DEFAULT_INITIAL_VALUES), { sshPublicKey: (_a = infraEnv.sshAuthorizedKey) !== null && _a !== void 0 ? _a : '', pullSecret: storedPullSecret !== null && storedPullSecret !== void 0 ? storedPullSecret : '', enableProxy: !!(((_b = infraEnv.proxy) === null || _b === void 0 ? void 0 : _b.httpProxy) || ((_c = infraEnv.proxy) === null || _c === void 0 ? void 0 : _c.httpsProxy)), httpProxy: (_e = (_d = infraEnv.proxy) === null || _d === void 0 ? void 0 : _d.httpProxy) !== null && _e !== void 0 ? _e : '', httpsProxy: (_g = (_f = infraEnv.proxy) === null || _f === void 0 ? void 0 : _f.httpsProxy) !== null && _g !== void 0 ? _g : '', noProxy: (_j = (_h = infraEnv.proxy) === null || _h === void 0 ? void 0 : _h.noProxy) !== null && _j !== void 0 ? _j : '', enableNtpSources: !!infraEnv.additionalNtpSources, additionalNtpSources: (_k = infraEnv.additionalNtpSources) !== null && _k !== void 0 ? _k : '', hostsNetworkConfigurationType: infraEnv.hostsNetworkConfigurationType === 'static'
|
|
49
|
-
? types_1.HostsNetworkConfigurationType.STATIC
|
|
50
|
-
: types_1.HostsNetworkConfigurationType.DHCP, rendezvousIp: (_l = infraEnv.rendezvousIp) !== null && _l !== void 0 ? _l : '' }));
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Builds common infrastructure environment params from form values
|
|
54
|
-
*/
|
|
55
|
-
const buildInfraEnvParams = (values) => {
|
|
56
|
-
// Build proxy object - only include fields that have values
|
|
57
|
-
const proxy = Object.assign(Object.assign(Object.assign({}, (values.httpProxy && { httpProxy: values.httpProxy })), (values.httpsProxy && { httpsProxy: values.httpsProxy })), (values.noProxy && { noProxy: values.noProxy }));
|
|
58
|
-
const hasProxy = Object.keys(proxy).length > 0;
|
|
59
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ pullSecret: values.pullSecret }, (values.sshPublicKey && { sshAuthorizedKey: values.sshPublicKey })), (hasProxy && { proxy })), (values.additionalNtpSources && {
|
|
60
|
-
additionalNtpSources: values.additionalNtpSources,
|
|
61
|
-
})), (values.rendezvousIp && { rendezvousIp: values.rendezvousIp })), (values.hostsNetworkConfigurationType === types_1.HostsNetworkConfigurationType.STATIC && {
|
|
62
|
-
staticNetworkConfig: (0, dummyData_1.getDummyInfraEnvField)(),
|
|
63
|
-
}));
|
|
64
|
-
};
|
|
65
|
-
const getValidationSchema = (t) => Yup.lazy((values) => Yup.object().shape({
|
|
66
|
-
sshPublicKey: (0, common_1.sshPublicKeyValidationSchema)(t),
|
|
67
|
-
pullSecret: (0, common_1.pullSecretValidationSchema)(t).required('Required field'),
|
|
68
|
-
enableProxy: Yup.boolean().required(),
|
|
69
|
-
httpProxy: (0, common_1.httpProxyValidationSchema)({
|
|
70
|
-
values,
|
|
71
|
-
pairValueName: 'httpsProxy',
|
|
72
|
-
allowEmpty: true,
|
|
73
|
-
t,
|
|
74
|
-
}),
|
|
75
|
-
httpsProxy: (0, common_1.httpProxyValidationSchema)({
|
|
76
|
-
values,
|
|
77
|
-
pairValueName: 'httpProxy',
|
|
78
|
-
allowEmpty: true,
|
|
79
|
-
t,
|
|
80
|
-
}),
|
|
81
|
-
noProxy: (0, common_1.noProxyValidationSchema)(t),
|
|
82
|
-
enableNtpSources: Yup.boolean().required(),
|
|
83
|
-
additionalNtpSources: (0, ntpValidation_1.ntpSourceValidationSchema)(t),
|
|
84
|
-
hostsNetworkConfigurationType: Yup.string()
|
|
85
|
-
.oneOf(Object.values(types_1.HostsNetworkConfigurationType))
|
|
86
|
-
.required(),
|
|
87
|
-
rendezvousIp: Yup.string()
|
|
88
|
-
.max(45, 'IP address must be at most 45 characters')
|
|
89
|
-
.test('ip-validation', 'Not a valid IP address', (value) => !value || (0, common_1.ipValidationSchema)(t).isValidSync(value)),
|
|
90
|
-
}));
|
|
91
|
-
const PullSecretSync = () => {
|
|
92
|
-
const defaultPullSecret = (0, usePullSecret_1.default)();
|
|
93
|
-
const { setFieldValue, values: { pullSecret }, } = (0, formik_1.useFormikContext)();
|
|
94
|
-
React.useEffect(() => {
|
|
95
|
-
if (defaultPullSecret !== undefined && pullSecret === '') {
|
|
96
|
-
setFieldValue('pullSecret', defaultPullSecret);
|
|
97
|
-
}
|
|
98
|
-
}, [defaultPullSecret, pullSecret, setFieldValue]);
|
|
99
|
-
return null;
|
|
100
|
-
};
|
|
101
|
-
const OptionalConfigurationsStep = () => {
|
|
102
|
-
const { clusterId } = (0, react_router_dom_v5_compat_1.useParams)();
|
|
103
|
-
const [cluster, setCluster] = React.useState(null);
|
|
104
|
-
const { t } = (0, use_translation_wrapper_1.useTranslation)();
|
|
105
|
-
const { moveNext, moveBack, setDisconnectedInfraEnv, disconnectedInfraEnv, disconnectedFormPullSecret, setDisconnectedFormPullSecret, disconnectedFormEditPullSecret, setDisconnectedFormEditPullSecret, } = (0, ClusterWizardContext_1.useClusterWizardContext)();
|
|
106
|
-
const { addAlert, clearAlerts } = (0, AlertsContextProvider_1.useAlerts)();
|
|
107
|
-
React.useEffect(() => {
|
|
108
|
-
const fetchCluster = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
109
|
-
if (!clusterId) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const fetchedCluster = yield ClustersService_1.default.get(clusterId);
|
|
114
|
-
setCluster(fetchedCluster);
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
(0, api_1.handleApiError)(error, () => {
|
|
118
|
-
addAlert({
|
|
119
|
-
title: t('ai:Failed to fetch cluster'),
|
|
120
|
-
message: (0, api_1.getApiErrorMessage)(error),
|
|
121
|
-
variant: react_core_2.AlertVariant.danger,
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
void fetchCluster();
|
|
127
|
-
}, [clusterId, addAlert, t]);
|
|
128
|
-
const initialValues = disconnectedInfraEnv
|
|
129
|
-
? infraEnvToFormValues(disconnectedInfraEnv, disconnectedFormPullSecret)
|
|
130
|
-
: DEFAULT_INITIAL_VALUES;
|
|
131
|
-
return (React.createElement(formik_1.Formik, { initialValues: initialValues, validateOnMount: true, validationSchema: getValidationSchema(t), onSubmit: (values) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
132
|
-
clearAlerts();
|
|
133
|
-
if (!(cluster === null || cluster === void 0 ? void 0 : cluster.id)) {
|
|
134
|
-
addAlert({
|
|
135
|
-
title: t('ai:Missing cluster'),
|
|
136
|
-
message: t('ai:Cluster must be created before configuring infrastructure environment'),
|
|
137
|
-
variant: react_core_2.AlertVariant.danger,
|
|
138
|
-
});
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const commonParams = buildInfraEnvParams(values);
|
|
142
|
-
try {
|
|
143
|
-
if (disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id) {
|
|
144
|
-
// Update existing infraEnv
|
|
145
|
-
const updateParams = Object.assign(Object.assign({}, commonParams), { imageType: DISCONNECTED_IMAGE_TYPE });
|
|
146
|
-
const { data: updatedInfraEnv } = yield apis_1.InfraEnvsAPI.update(disconnectedInfraEnv.id, updateParams);
|
|
147
|
-
setDisconnectedFormPullSecret(values.pullSecret);
|
|
148
|
-
setDisconnectedFormEditPullSecret(disconnectedFormEditPullSecret !== null && disconnectedFormEditPullSecret !== void 0 ? disconnectedFormEditPullSecret : !!(disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.pullSecretSet));
|
|
149
|
-
setDisconnectedInfraEnv(Object.assign(Object.assign({}, updatedInfraEnv), {
|
|
150
|
-
// infraEnv does not return the whole OCP version
|
|
151
|
-
openshiftVersion: cluster.openshiftVersion }));
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
// Create new infraEnv
|
|
155
|
-
const createParams = Object.assign({ name: InfraEnvsService_1.default.makeInfraEnvName(DEFAULT_CPU_ARCHITECTURE, cluster.name), clusterId: cluster.id, openshiftVersion: cluster.openshiftVersion, cpuArchitecture: DEFAULT_CPU_ARCHITECTURE, imageType: DISCONNECTED_IMAGE_TYPE }, commonParams);
|
|
156
|
-
const createdInfraEnv = yield InfraEnvsService_1.default.create(createParams);
|
|
157
|
-
setDisconnectedFormPullSecret(values.pullSecret);
|
|
158
|
-
setDisconnectedFormEditPullSecret(disconnectedFormEditPullSecret !== null && disconnectedFormEditPullSecret !== void 0 ? disconnectedFormEditPullSecret : !!(disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.pullSecretSet));
|
|
159
|
-
setDisconnectedInfraEnv(Object.assign(Object.assign({}, createdInfraEnv), {
|
|
160
|
-
// infraEnv does not return the whole OCP version
|
|
161
|
-
openshiftVersion: cluster.openshiftVersion }));
|
|
162
|
-
}
|
|
163
|
-
moveNext();
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
(0, api_1.handleApiError)(error, () => {
|
|
167
|
-
addAlert({
|
|
168
|
-
title: (disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id)
|
|
169
|
-
? t('ai:Failed to update infrastructure environment')
|
|
170
|
-
: t('ai:Failed to create infrastructure environment'),
|
|
171
|
-
message: (0, api_1.getApiErrorMessage)(error),
|
|
172
|
-
variant: react_core_2.AlertVariant.danger,
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}) }, ({ submitForm, isValid, errors, touched, isSubmitting, values }) => {
|
|
177
|
-
const errorFields = (0, common_1.getFormikErrorFields)(errors, touched);
|
|
178
|
-
const handleNext = () => {
|
|
179
|
-
void submitForm(); // This will trigger onSubmit
|
|
180
|
-
};
|
|
181
|
-
return (React.createElement(common_1.ClusterWizardStep, { navigation: React.createElement(ClusterWizardNavigation_1.default, null), footer: React.createElement(ClusterWizardFooter_1.default, { disconnectedClusterId: clusterId, onNext: handleNext, onBack: moveBack, isNextDisabled: !isValid || !cluster, errorFields: errorFields, isSubmitting: isSubmitting }) },
|
|
182
|
-
React.createElement(WithErrorBoundary_1.WithErrorBoundary, { title: "Failed to load Optional Configurations step" },
|
|
183
|
-
React.createElement(PullSecretSync, null),
|
|
184
|
-
React.createElement(react_core_1.Grid, { hasGutter: true },
|
|
185
|
-
React.createElement(react_core_1.GridItem, null,
|
|
186
|
-
React.createElement(react_core_1.Split, null,
|
|
187
|
-
React.createElement(react_core_1.SplitItem, null,
|
|
188
|
-
React.createElement(react_core_1.Content, { component: "h2" }, t('ai:Optional configurations'))),
|
|
189
|
-
React.createElement(react_core_1.SplitItem, null,
|
|
190
|
-
React.createElement(common_1.TechnologyPreview, null)))),
|
|
191
|
-
React.createElement(react_core_1.GridItem, null,
|
|
192
|
-
React.createElement(react_core_1.Form, { id: "wizard-cluster-optional-configurations__form" },
|
|
193
|
-
React.createElement(common_1.InputField, { label: t('ai:Rendezvous IP'), name: "rendezvousIp", helperText: t('ai:The IP address that hosts will use to communicate with the bootstrap node during installation.'), placeholder: "e.g., 192.168.1.10", maxLength: 45 }),
|
|
194
|
-
React.createElement(UploadSSH_1.default, null),
|
|
195
|
-
React.createElement(react_core_1.Checkbox, { label: t('ai:Edit pull secret'), isChecked: disconnectedFormEditPullSecret !== null && disconnectedFormEditPullSecret !== void 0 ? disconnectedFormEditPullSecret : !!(disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.pullSecretSet), onChange: (_, checked) => setDisconnectedFormEditPullSecret(checked), id: "edit-pull-secret-checkbox" }),
|
|
196
|
-
(disconnectedFormEditPullSecret !== null && disconnectedFormEditPullSecret !== void 0 ? disconnectedFormEditPullSecret : !!(disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.pullSecretSet)) && (React.createElement(PullSecretField_1.default, { isOcm: api_1.isInOcm })),
|
|
197
|
-
React.createElement(common_1.CheckboxField, { label: t('ai:Configure proxy settings'), name: "enableProxy", helperText: React.createElement("p", null, t('ai:If hosts are behind a firewall that requires the use of a proxy, provide additional information about the proxy.')), body: values.enableProxy && React.createElement(ProxyFields_1.ProxyInputFields, null) }),
|
|
198
|
-
React.createElement(common_1.CheckboxField, { label: t('ai:Add your own NTP (Network Time Protocol) sources'), name: "enableNtpSources", helperText: React.createElement("p", null, t('ai:Configure your own NTP sources to synchronize the time between the hosts that will be added to this infrastructure environment.')), body: values.enableNtpSources && (React.createElement(react_core_1.Grid, { hasGutter: true },
|
|
199
|
-
React.createElement(common_1.AdditionalNTPSourcesField, { name: "additionalNtpSources", helperText: t('ai:A comma separated list of IP or domain names of the NTP pools or servers.') }))) }),
|
|
200
|
-
React.createElement(HostsNetworkConfigurationControlGroup_1.HostsNetworkConfigurationControlGroup, { clusterExists: false, isDisabled: false })))))));
|
|
201
|
-
}));
|
|
202
|
-
};
|
|
203
|
-
exports.default = OptionalConfigurationsStep;
|
|
204
|
-
//# sourceMappingURL=OptionalConfigurationsStep.js.map
|