@openshift-assisted/ui-lib 2.51.0 → 2.51.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/StackTypeControlGroup.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 +0 -7
- package/build/@types/common/config/constants.d.ts.map +1 -1
- package/build/@types/common/types/index.d.ts +1 -0
- package/build/@types/common/types/index.d.ts.map +1 -1
- package/build/@types/common/types/networkType.d.ts +12 -0
- package/build/@types/common/types/networkType.d.ts.map +1 -0
- 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/manifestsConfiguration/CustomManifestsPage.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts +1 -2
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts +0 -22
- package/build/@types/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetailsForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterWizardContext.d.ts +0 -3
- 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/components/featureSupportLevels/featureStateUtils.d.ts.map +1 -1
- package/build/@types/ocm/components/utils.d.ts +0 -1
- package/build/@types/ocm/components/utils.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/@types/ocm/store/slices/clusters/selectors.d.ts +1 -2
- package/build/@types/ocm/store/slices/clusters/selectors.d.ts.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js +3 -3
- package/build/cjs/cim/components/ClusterDeployment/networkConfigurationValidation.js.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/NetworkTypeControlGroup.js +3 -3
- package/build/cjs/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js +3 -2
- package/build/cjs/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.js +2 -1
- 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 +2 -21
- package/build/cjs/common/config/constants.js.map +1 -1
- package/build/cjs/common/types/index.js +1 -0
- package/build/cjs/common/types/index.js.map +1 -1
- package/build/cjs/common/types/networkType.js +28 -0
- package/build/cjs/common/types/networkType.js.map +1 -0
- package/build/cjs/common/validationSchemas/addressValidation.js +1 -3
- 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/manifestsConfiguration/CustomManifestsPage.js +7 -5
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/CustomManifestsPage.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.js +4 -1
- package/build/cjs/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js +1 -4
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js +22 -29
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js +2 -5
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js +3 -31
- package/build/cjs/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +1 -2
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js +1 -2
- package/build/cjs/ocm/components/clusterWizard/ClusterDetailsForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContext.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterWizardContextProvider.js +9 -62
- 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 +19 -96
- package/build/cjs/ocm/components/clusterWizard/disconnected/BasicStep.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/disconnected/ReviewStep.js +7 -11
- 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/components/featureSupportLevels/featureStateUtils.js +13 -4
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
- package/build/cjs/ocm/components/utils.js +1 -4
- package/build/cjs/ocm/components/utils.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/build/cjs/ocm/store/slices/clusters/selectors.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/networkConfigurationValidation.ts +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/NetworkTypeControlGroup.tsx +1 -1
- package/lib/common/components/clusterWizard/networkingSteps/StackTypeControlGroup.tsx +5 -6
- package/lib/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.tsx +2 -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 -21
- package/lib/common/types/index.ts +1 -0
- package/lib/common/types/networkType.ts +37 -0
- package/lib/common/validationSchemas/addressValidation.tsx +1 -4
- 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/manifestsConfiguration/CustomManifestsPage.tsx +10 -5
- package/lib/ocm/components/clusterConfiguration/manifestsConfiguration/components/CustomManifestsArray.tsx +5 -1
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx +0 -5
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkTypeDropdown.tsx +32 -47
- package/lib/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.tsx +2 -8
- package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.tsx +0 -1
- package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.tsx +2 -2
- package/lib/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.tsx +24 -63
- package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +1 -2
- package/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx +2 -1
- package/lib/ocm/components/clusterWizard/ClusterWizardContext.tsx +0 -3
- package/lib/ocm/components/clusterWizard/ClusterWizardContextProvider.tsx +27 -91
- 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 +39 -139
- package/lib/ocm/components/clusterWizard/disconnected/ReviewStep.tsx +9 -19
- package/lib/ocm/components/clusterWizard/index.ts +0 -1
- package/lib/ocm/components/clusterWizard/wizardTransition.ts +1 -5
- package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +15 -4
- package/lib/ocm/components/utils.ts +0 -4
- 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/lib/ocm/store/slices/clusters/selectors.tsx +2 -1
- 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 -182
- 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 -364
|
@@ -1,182 +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 ProxyFields_1 = require("../../../../common/components/clusterConfiguration/ProxyFields");
|
|
15
|
-
const api_1 = require("../../../../common/api");
|
|
16
|
-
const AlertsContextProvider_1 = require("../../../../common/components/AlertsContextProvider");
|
|
17
|
-
const react_core_2 = require("@patternfly/react-core");
|
|
18
|
-
const InfraEnvsService_1 = tslib_1.__importDefault(require("../../../services/InfraEnvsService"));
|
|
19
|
-
const apis_1 = require("../../../services/apis");
|
|
20
|
-
const usePullSecret_1 = tslib_1.__importDefault(require("../../../hooks/usePullSecret"));
|
|
21
|
-
const react_router_dom_v5_compat_1 = require("react-router-dom-v5-compat");
|
|
22
|
-
const ClustersService_1 = tslib_1.__importDefault(require("../../../services/ClustersService"));
|
|
23
|
-
const HostsNetworkConfigurationControlGroup_1 = require("../../clusterConfiguration/HostsNetworkConfigurationControlGroup");
|
|
24
|
-
const types_1 = require("../../../services/types");
|
|
25
|
-
const use_translation_wrapper_1 = require("../../../../common/hooks/use-translation-wrapper");
|
|
26
|
-
const dummyData_1 = require("../../clusterConfiguration/staticIp/data/dummyData");
|
|
27
|
-
const ntpValidation_1 = require("../../../../common/validationSchemas/ntpValidation");
|
|
28
|
-
const api_2 = require("../../../../common/api");
|
|
29
|
-
const DEFAULT_CPU_ARCHITECTURE = 'x86_64';
|
|
30
|
-
const DISCONNECTED_IMAGE_TYPE = 'disconnected-iso';
|
|
31
|
-
const DEFAULT_INITIAL_VALUES = {
|
|
32
|
-
sshPublicKey: '',
|
|
33
|
-
enableProxy: false,
|
|
34
|
-
httpProxy: '',
|
|
35
|
-
httpsProxy: '',
|
|
36
|
-
noProxy: '',
|
|
37
|
-
enableNtpSources: false,
|
|
38
|
-
additionalNtpSources: '',
|
|
39
|
-
hostsNetworkConfigurationType: types_1.HostsNetworkConfigurationType.DHCP,
|
|
40
|
-
rendezvousIp: '',
|
|
41
|
-
pullSecret: '',
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Rehydrate form values from infraEnv when navigating back to this step.
|
|
45
|
-
*/
|
|
46
|
-
const infraEnvToFormValues = (infraEnv) => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
48
|
-
return (Object.assign(Object.assign({}, DEFAULT_INITIAL_VALUES), { sshPublicKey: (_a = infraEnv.sshAuthorizedKey) !== null && _a !== void 0 ? _a : '', 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: ((_m = (_l = infraEnv.staticNetworkConfig) === null || _l === void 0 ? void 0 : _l.length) !== null && _m !== void 0 ? _m : 0) > 0
|
|
49
|
-
? types_1.HostsNetworkConfigurationType.STATIC
|
|
50
|
-
: types_1.HostsNetworkConfigurationType.DHCP, rendezvousIp: (_o = infraEnv.rendezvousIp) !== null && _o !== void 0 ? _o : '' }));
|
|
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({}, (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, requirePullSecret) => Yup.lazy((values) => Yup.object().shape(Object.assign({ sshPublicKey: (0, common_1.sshPublicKeyValidationSchema)(t), enableProxy: Yup.boolean().required(), httpProxy: (0, common_1.httpProxyValidationSchema)({
|
|
66
|
-
values,
|
|
67
|
-
pairValueName: 'httpsProxy',
|
|
68
|
-
allowEmpty: true,
|
|
69
|
-
t,
|
|
70
|
-
}), httpsProxy: (0, common_1.httpProxyValidationSchema)({
|
|
71
|
-
values,
|
|
72
|
-
pairValueName: 'httpProxy',
|
|
73
|
-
allowEmpty: true,
|
|
74
|
-
t,
|
|
75
|
-
}), noProxy: (0, common_1.noProxyValidationSchema)(t), enableNtpSources: Yup.boolean().required(), additionalNtpSources: (0, ntpValidation_1.ntpSourceValidationSchema)(t), hostsNetworkConfigurationType: Yup.string()
|
|
76
|
-
.oneOf(Object.values(types_1.HostsNetworkConfigurationType))
|
|
77
|
-
.required(), rendezvousIp: Yup.string()
|
|
78
|
-
.max(45, 'IP address must be at most 45 characters')
|
|
79
|
-
.test('ip-validation', 'Not a valid IP address', (value) => !value || (0, common_1.ipValidationSchema)(t).isValidSync(value)) }, (requirePullSecret && {
|
|
80
|
-
pullSecret: (0, common_1.pullSecretValidationSchema)(t).required(t('ai:Required field')),
|
|
81
|
-
}))));
|
|
82
|
-
const OptionalConfigurationsStep = () => {
|
|
83
|
-
const { clusterId } = (0, react_router_dom_v5_compat_1.useParams)();
|
|
84
|
-
const [cluster, setCluster] = React.useState(null);
|
|
85
|
-
const { t } = (0, use_translation_wrapper_1.useTranslation)();
|
|
86
|
-
const defaultPullSecret = (0, usePullSecret_1.default)();
|
|
87
|
-
const { moveNext, moveBack, setDisconnectedInfraEnv, disconnectedInfraEnv } = (0, ClusterWizardContext_1.useClusterWizardContext)();
|
|
88
|
-
const { addAlert, clearAlerts } = (0, AlertsContextProvider_1.useAlerts)();
|
|
89
|
-
React.useEffect(() => {
|
|
90
|
-
const fetchCluster = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
91
|
-
if (!clusterId) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
try {
|
|
95
|
-
const fetchedCluster = yield ClustersService_1.default.get(clusterId);
|
|
96
|
-
setCluster(fetchedCluster);
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
(0, api_1.handleApiError)(error, () => {
|
|
100
|
-
addAlert({
|
|
101
|
-
title: t('ai:Failed to fetch cluster'),
|
|
102
|
-
message: (0, api_1.getApiErrorMessage)(error),
|
|
103
|
-
variant: react_core_2.AlertVariant.danger,
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
void fetchCluster();
|
|
109
|
-
}, [clusterId, addAlert, t]);
|
|
110
|
-
const initialValues = disconnectedInfraEnv
|
|
111
|
-
? infraEnvToFormValues(disconnectedInfraEnv)
|
|
112
|
-
: DEFAULT_INITIAL_VALUES;
|
|
113
|
-
return (React.createElement(formik_1.Formik, { initialValues: initialValues, validateOnMount: true, validationSchema: getValidationSchema(t, !api_2.isInOcm), onSubmit: (values) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
114
|
-
clearAlerts();
|
|
115
|
-
if (!(cluster === null || cluster === void 0 ? void 0 : cluster.id)) {
|
|
116
|
-
addAlert({
|
|
117
|
-
title: t('ai:Missing cluster'),
|
|
118
|
-
message: t('ai:Cluster must be created before configuring infrastructure environment'),
|
|
119
|
-
variant: react_core_2.AlertVariant.danger,
|
|
120
|
-
});
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
const commonParams = buildInfraEnvParams(values);
|
|
124
|
-
// Default pull secret only exists in OCM; when !isInOcm the user must provide it via the field
|
|
125
|
-
const pullSecretToUse = api_2.isInOcm ? defaultPullSecret : values.pullSecret;
|
|
126
|
-
try {
|
|
127
|
-
if (disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id) {
|
|
128
|
-
// Update existing infraEnv
|
|
129
|
-
const updateParams = Object.assign(Object.assign({}, commonParams), { imageType: DISCONNECTED_IMAGE_TYPE, pullSecret: pullSecretToUse });
|
|
130
|
-
const { data: updatedInfraEnv } = yield apis_1.InfraEnvsAPI.update(disconnectedInfraEnv.id, updateParams);
|
|
131
|
-
setDisconnectedInfraEnv(Object.assign(Object.assign({}, updatedInfraEnv), {
|
|
132
|
-
// infraEnv does not return the whole OCP version
|
|
133
|
-
openshiftVersion: cluster.openshiftVersion }));
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
// Create new infraEnv
|
|
137
|
-
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, pullSecret: pullSecretToUse !== null && pullSecretToUse !== void 0 ? pullSecretToUse : '' }, commonParams);
|
|
138
|
-
const createdInfraEnv = yield InfraEnvsService_1.default.create(createParams);
|
|
139
|
-
setDisconnectedInfraEnv(Object.assign(Object.assign({}, createdInfraEnv), {
|
|
140
|
-
// infraEnv does not return the whole OCP version
|
|
141
|
-
openshiftVersion: cluster.openshiftVersion }));
|
|
142
|
-
}
|
|
143
|
-
moveNext();
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
(0, api_1.handleApiError)(error, () => {
|
|
147
|
-
addAlert({
|
|
148
|
-
title: (disconnectedInfraEnv === null || disconnectedInfraEnv === void 0 ? void 0 : disconnectedInfraEnv.id)
|
|
149
|
-
? t('ai:Failed to update infrastructure environment')
|
|
150
|
-
: t('ai:Failed to create infrastructure environment'),
|
|
151
|
-
message: (0, api_1.getApiErrorMessage)(error),
|
|
152
|
-
variant: react_core_2.AlertVariant.danger,
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}) }, ({ submitForm, isValid, errors, touched, isSubmitting, values }) => {
|
|
157
|
-
const errorFields = (0, common_1.getFormikErrorFields)(errors, touched);
|
|
158
|
-
const handleNext = () => {
|
|
159
|
-
void submitForm(); // This will trigger onSubmit
|
|
160
|
-
};
|
|
161
|
-
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 }) },
|
|
162
|
-
React.createElement(WithErrorBoundary_1.WithErrorBoundary, { title: "Failed to load Optional Configurations step" },
|
|
163
|
-
React.createElement(react_core_1.Grid, { hasGutter: true },
|
|
164
|
-
React.createElement(react_core_1.GridItem, null,
|
|
165
|
-
React.createElement(react_core_1.Split, null,
|
|
166
|
-
React.createElement(react_core_1.SplitItem, null,
|
|
167
|
-
React.createElement(react_core_1.Content, { component: "h2" }, t('ai:Optional configurations'))),
|
|
168
|
-
React.createElement(react_core_1.SplitItem, null,
|
|
169
|
-
React.createElement(common_1.TechnologyPreview, null)))),
|
|
170
|
-
React.createElement(react_core_1.GridItem, null,
|
|
171
|
-
React.createElement(react_core_1.Form, { id: "wizard-cluster-optional-configurations__form" },
|
|
172
|
-
!api_2.isInOcm && React.createElement(common_1.PullSecret, { defaultPullSecret: defaultPullSecret, isOcm: false }),
|
|
173
|
-
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 }),
|
|
174
|
-
React.createElement(UploadSSH_1.default, null),
|
|
175
|
-
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) }),
|
|
176
|
-
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 },
|
|
177
|
-
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.') }))) }),
|
|
178
|
-
React.createElement(HostsNetworkConfigurationControlGroup_1.HostsNetworkConfigurationControlGroup, { clusterExists: false, isDisabled: false })))))));
|
|
179
|
-
}));
|
|
180
|
-
};
|
|
181
|
-
exports.default = OptionalConfigurationsStep;
|
|
182
|
-
//# sourceMappingURL=OptionalConfigurationsStep.js.map
|
package/build/cjs/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionalConfigurationsStep.js","sourceRoot":"","sources":["../../../../../../lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,mCAAgC;AAEhC,iDAA2B;AAC3B,+CAc4B;AAC5B,uDAAyF;AACzF,kEAAkE;AAClE,yFAAyD;AACzD,iGAAiE;AACjE,qGAAkG;AAClG,qHAAqF;AACrF,gGAAkG;AAClG,gDAA4E;AAC5E,+FAAgF;AAChF,uDAAsD;AACtD,kGAAkE;AAClE,iDAAsD;AACtD,yFAAyD;AACzD,2EAAuD;AACvD,gGAAgE;AAOhE,4HAAyH;AACzH,mD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CACX,8EAA8E,CAC/E,GACD,CACG,CACR,GAEH;4BAGF,oBAAC,6EAAqC,IACpC,aAAa,EAAE,KAAK,EACpB,UAAU,EAAE,KAAK,GACjB,CACG,CACE,CACN,CACW,CACF,CACrB,CAAC;IACJ,CAAC,CACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,0BAA0B,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ClusterWizardStep, getFormikErrorFields, useAlerts } from '../../../../common';
|
|
3
|
-
import { useClusterWizardContext } from '../ClusterWizardContext';
|
|
4
|
-
import ClusterWizardFooter from '../ClusterWizardFooter';
|
|
5
|
-
import ClusterWizardNavigation from '../ClusterWizardNavigation';
|
|
6
|
-
import { StaticIpFormState } from '../../clusterConfiguration/staticIp/components/propTypes';
|
|
7
|
-
import { StaticIpPage } from '../../clusterConfiguration/staticIp/components/StaticIpPage';
|
|
8
|
-
import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary';
|
|
9
|
-
import { InfraEnvsAPI } from '../../../services/apis';
|
|
10
|
-
import { InfraEnvUpdateParams } from '@openshift-assisted/types/assisted-installer-service';
|
|
11
|
-
|
|
12
|
-
const getInitialFormStateProps = (): StaticIpFormState => {
|
|
13
|
-
return {
|
|
14
|
-
isValid: true,
|
|
15
|
-
isSubmitting: false,
|
|
16
|
-
isAutoSaveRunning: false,
|
|
17
|
-
errors: {},
|
|
18
|
-
touched: {},
|
|
19
|
-
isEmpty: true,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const DisconnectedStaticIp: React.FC = () => {
|
|
24
|
-
const { moveNext, moveBack, disconnectedInfraEnv, setDisconnectedInfraEnv } =
|
|
25
|
-
useClusterWizardContext();
|
|
26
|
-
const { alerts } = useAlerts();
|
|
27
|
-
const [formState, setFormStateProps] = React.useState<StaticIpFormState>(
|
|
28
|
-
getInitialFormStateProps(),
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const onFormStateChange = (formState: StaticIpFormState) => {
|
|
32
|
-
setFormStateProps(formState);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const updateInfraEnv = async (params: InfraEnvUpdateParams) => {
|
|
36
|
-
if (!disconnectedInfraEnv?.id) {
|
|
37
|
-
throw new Error('No disconnected infraEnv available');
|
|
38
|
-
}
|
|
39
|
-
const { data: updatedInfraEnv } = await InfraEnvsAPI.update(disconnectedInfraEnv.id, params);
|
|
40
|
-
setDisconnectedInfraEnv(updatedInfraEnv);
|
|
41
|
-
return updatedInfraEnv;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const isNextDisabled =
|
|
45
|
-
formState.isAutoSaveRunning || !formState.isValid || !!alerts.length || formState.isSubmitting;
|
|
46
|
-
const errorFields = getFormikErrorFields<object>(formState.errors, formState.touched);
|
|
47
|
-
|
|
48
|
-
const footer = (
|
|
49
|
-
<ClusterWizardFooter
|
|
50
|
-
alertTitle="Static IP configuration contains missing or invalid fields"
|
|
51
|
-
alertContent={null}
|
|
52
|
-
errorFields={errorFields}
|
|
53
|
-
isSubmitting={formState.isSubmitting}
|
|
54
|
-
onNext={() => moveNext()}
|
|
55
|
-
onBack={() => moveBack()}
|
|
56
|
-
isNextDisabled={isNextDisabled}
|
|
57
|
-
isBackDisabled={formState.isSubmitting || formState.isAutoSaveRunning}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
if (!disconnectedInfraEnv) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<ClusterWizardStep navigation={<ClusterWizardNavigation />} footer={footer}>
|
|
67
|
-
<WithErrorBoundary title="Failed to load Static IP step">
|
|
68
|
-
<StaticIpPage
|
|
69
|
-
infraEnv={disconnectedInfraEnv}
|
|
70
|
-
updateInfraEnv={updateInfraEnv}
|
|
71
|
-
onFormStateChange={onFormStateChange}
|
|
72
|
-
/>
|
|
73
|
-
</WithErrorBoundary>
|
|
74
|
-
</ClusterWizardStep>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default DisconnectedStaticIp;
|
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Formik } from 'formik';
|
|
3
|
-
import { TFunction } from 'i18next';
|
|
4
|
-
import * as Yup from 'yup';
|
|
5
|
-
import {
|
|
6
|
-
ClusterWizardStep,
|
|
7
|
-
TechnologyPreview,
|
|
8
|
-
sshPublicKeyValidationSchema,
|
|
9
|
-
getFormikErrorFields,
|
|
10
|
-
httpProxyValidationSchema,
|
|
11
|
-
noProxyValidationSchema,
|
|
12
|
-
ipValidationSchema,
|
|
13
|
-
InputField,
|
|
14
|
-
CheckboxField,
|
|
15
|
-
AdditionalNTPSourcesField,
|
|
16
|
-
ProxyFieldsType,
|
|
17
|
-
PullSecret,
|
|
18
|
-
pullSecretValidationSchema,
|
|
19
|
-
} from '../../../../common';
|
|
20
|
-
import { Split, SplitItem, Grid, GridItem, Form, Content } from '@patternfly/react-core';
|
|
21
|
-
import { useClusterWizardContext } from '../ClusterWizardContext';
|
|
22
|
-
import ClusterWizardFooter from '../ClusterWizardFooter';
|
|
23
|
-
import ClusterWizardNavigation from '../ClusterWizardNavigation';
|
|
24
|
-
import { WithErrorBoundary } from '../../../../common/components/ErrorHandling/WithErrorBoundary';
|
|
25
|
-
import UploadSSH from '../../../../common/components/clusterConfiguration/UploadSSH';
|
|
26
|
-
import { ProxyInputFields } from '../../../../common/components/clusterConfiguration/ProxyFields';
|
|
27
|
-
import { handleApiError, getApiErrorMessage } from '../../../../common/api';
|
|
28
|
-
import { useAlerts } from '../../../../common/components/AlertsContextProvider';
|
|
29
|
-
import { AlertVariant } from '@patternfly/react-core';
|
|
30
|
-
import InfraEnvsService from '../../../services/InfraEnvsService';
|
|
31
|
-
import { InfraEnvsAPI } from '../../../services/apis';
|
|
32
|
-
import usePullSecret from '../../../hooks/usePullSecret';
|
|
33
|
-
import { useParams } from 'react-router-dom-v5-compat';
|
|
34
|
-
import ClustersService from '../../../services/ClustersService';
|
|
35
|
-
import {
|
|
36
|
-
Cluster,
|
|
37
|
-
InfraEnv,
|
|
38
|
-
InfraEnvCreateParams,
|
|
39
|
-
InfraEnvUpdateParams,
|
|
40
|
-
} from '@openshift-assisted/types/assisted-installer-service';
|
|
41
|
-
import { HostsNetworkConfigurationControlGroup } from '../../clusterConfiguration/HostsNetworkConfigurationControlGroup';
|
|
42
|
-
import { HostsNetworkConfigurationType } from '../../../services/types';
|
|
43
|
-
import { useTranslation } from '../../../../common/hooks/use-translation-wrapper';
|
|
44
|
-
import { getDummyInfraEnvField } from '../../clusterConfiguration/staticIp/data/dummyData';
|
|
45
|
-
import { ntpSourceValidationSchema } from '../../../../common/validationSchemas/ntpValidation';
|
|
46
|
-
import { isInOcm } from '../../../../common/api';
|
|
47
|
-
|
|
48
|
-
const DEFAULT_CPU_ARCHITECTURE = 'x86_64' as const;
|
|
49
|
-
const DISCONNECTED_IMAGE_TYPE = 'disconnected-iso' as const;
|
|
50
|
-
|
|
51
|
-
type OptionalConfigurationsFormValues = ProxyFieldsType & {
|
|
52
|
-
sshPublicKey?: string;
|
|
53
|
-
enableNtpSources: boolean;
|
|
54
|
-
additionalNtpSources?: string;
|
|
55
|
-
hostsNetworkConfigurationType: HostsNetworkConfigurationType;
|
|
56
|
-
rendezvousIp?: string;
|
|
57
|
-
pullSecret?: string;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const DEFAULT_INITIAL_VALUES: OptionalConfigurationsFormValues = {
|
|
61
|
-
sshPublicKey: '',
|
|
62
|
-
enableProxy: false,
|
|
63
|
-
httpProxy: '',
|
|
64
|
-
httpsProxy: '',
|
|
65
|
-
noProxy: '',
|
|
66
|
-
enableNtpSources: false,
|
|
67
|
-
additionalNtpSources: '',
|
|
68
|
-
hostsNetworkConfigurationType: HostsNetworkConfigurationType.DHCP,
|
|
69
|
-
rendezvousIp: '',
|
|
70
|
-
pullSecret: '',
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Rehydrate form values from infraEnv when navigating back to this step.
|
|
75
|
-
*/
|
|
76
|
-
const infraEnvToFormValues = (infraEnv: InfraEnv): OptionalConfigurationsFormValues => ({
|
|
77
|
-
...DEFAULT_INITIAL_VALUES,
|
|
78
|
-
sshPublicKey: infraEnv.sshAuthorizedKey ?? '',
|
|
79
|
-
enableProxy: !!(infraEnv.proxy?.httpProxy || infraEnv.proxy?.httpsProxy),
|
|
80
|
-
httpProxy: infraEnv.proxy?.httpProxy ?? '',
|
|
81
|
-
httpsProxy: infraEnv.proxy?.httpsProxy ?? '',
|
|
82
|
-
noProxy: infraEnv.proxy?.noProxy ?? '',
|
|
83
|
-
enableNtpSources: !!infraEnv.additionalNtpSources,
|
|
84
|
-
additionalNtpSources: infraEnv.additionalNtpSources ?? '',
|
|
85
|
-
hostsNetworkConfigurationType:
|
|
86
|
-
(infraEnv.staticNetworkConfig?.length ?? 0) > 0
|
|
87
|
-
? HostsNetworkConfigurationType.STATIC
|
|
88
|
-
: HostsNetworkConfigurationType.DHCP,
|
|
89
|
-
rendezvousIp: infraEnv.rendezvousIp ?? '',
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Builds common infrastructure environment params from form values
|
|
94
|
-
*/
|
|
95
|
-
const buildInfraEnvParams = (values: OptionalConfigurationsFormValues) => {
|
|
96
|
-
// Build proxy object - only include fields that have values
|
|
97
|
-
const proxy = {
|
|
98
|
-
...(values.httpProxy && { httpProxy: values.httpProxy }),
|
|
99
|
-
...(values.httpsProxy && { httpsProxy: values.httpsProxy }),
|
|
100
|
-
...(values.noProxy && { noProxy: values.noProxy }),
|
|
101
|
-
};
|
|
102
|
-
const hasProxy = Object.keys(proxy).length > 0;
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
...(values.sshPublicKey && { sshAuthorizedKey: values.sshPublicKey }),
|
|
106
|
-
...(hasProxy && { proxy }),
|
|
107
|
-
...(values.additionalNtpSources && {
|
|
108
|
-
additionalNtpSources: values.additionalNtpSources,
|
|
109
|
-
}),
|
|
110
|
-
...(values.rendezvousIp && { rendezvousIp: values.rendezvousIp }),
|
|
111
|
-
// Initialize with dummy static network config when static IP is selected
|
|
112
|
-
// This is required for the StaticIpPage to render properly
|
|
113
|
-
...(values.hostsNetworkConfigurationType === HostsNetworkConfigurationType.STATIC && {
|
|
114
|
-
staticNetworkConfig: getDummyInfraEnvField(),
|
|
115
|
-
}),
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const getValidationSchema = (t: TFunction, requirePullSecret: boolean) =>
|
|
120
|
-
Yup.lazy((values: OptionalConfigurationsFormValues) =>
|
|
121
|
-
Yup.object().shape({
|
|
122
|
-
sshPublicKey: sshPublicKeyValidationSchema(t),
|
|
123
|
-
enableProxy: Yup.boolean().required(),
|
|
124
|
-
httpProxy: httpProxyValidationSchema({
|
|
125
|
-
values,
|
|
126
|
-
pairValueName: 'httpsProxy',
|
|
127
|
-
allowEmpty: true,
|
|
128
|
-
t,
|
|
129
|
-
}),
|
|
130
|
-
httpsProxy: httpProxyValidationSchema({
|
|
131
|
-
values,
|
|
132
|
-
pairValueName: 'httpProxy',
|
|
133
|
-
allowEmpty: true,
|
|
134
|
-
t,
|
|
135
|
-
}),
|
|
136
|
-
noProxy: noProxyValidationSchema(t),
|
|
137
|
-
enableNtpSources: Yup.boolean().required(),
|
|
138
|
-
additionalNtpSources: ntpSourceValidationSchema(t),
|
|
139
|
-
hostsNetworkConfigurationType: Yup.string()
|
|
140
|
-
.oneOf(Object.values(HostsNetworkConfigurationType))
|
|
141
|
-
.required(),
|
|
142
|
-
rendezvousIp: Yup.string()
|
|
143
|
-
.max(45, 'IP address must be at most 45 characters')
|
|
144
|
-
.test(
|
|
145
|
-
'ip-validation',
|
|
146
|
-
'Not a valid IP address',
|
|
147
|
-
(value) => !value || ipValidationSchema(t).isValidSync(value),
|
|
148
|
-
),
|
|
149
|
-
...(requirePullSecret && {
|
|
150
|
-
pullSecret: pullSecretValidationSchema(t).required(t('ai:Required field')),
|
|
151
|
-
}),
|
|
152
|
-
}),
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
const OptionalConfigurationsStep = () => {
|
|
156
|
-
const { clusterId } = useParams<{ clusterId: string }>();
|
|
157
|
-
const [cluster, setCluster] = React.useState<Cluster | null>(null);
|
|
158
|
-
const { t } = useTranslation();
|
|
159
|
-
const defaultPullSecret = usePullSecret();
|
|
160
|
-
|
|
161
|
-
const { moveNext, moveBack, setDisconnectedInfraEnv, disconnectedInfraEnv } =
|
|
162
|
-
useClusterWizardContext();
|
|
163
|
-
const { addAlert, clearAlerts } = useAlerts();
|
|
164
|
-
|
|
165
|
-
React.useEffect(() => {
|
|
166
|
-
const fetchCluster = async () => {
|
|
167
|
-
if (!clusterId) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
try {
|
|
171
|
-
const fetchedCluster = await ClustersService.get(clusterId);
|
|
172
|
-
setCluster(fetchedCluster);
|
|
173
|
-
} catch (error) {
|
|
174
|
-
handleApiError(error, () => {
|
|
175
|
-
addAlert({
|
|
176
|
-
title: t('ai:Failed to fetch cluster'),
|
|
177
|
-
message: getApiErrorMessage(error),
|
|
178
|
-
variant: AlertVariant.danger,
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
void fetchCluster();
|
|
184
|
-
}, [clusterId, addAlert, t]);
|
|
185
|
-
|
|
186
|
-
const initialValues: OptionalConfigurationsFormValues = disconnectedInfraEnv
|
|
187
|
-
? infraEnvToFormValues(disconnectedInfraEnv)
|
|
188
|
-
: DEFAULT_INITIAL_VALUES;
|
|
189
|
-
|
|
190
|
-
return (
|
|
191
|
-
<Formik
|
|
192
|
-
initialValues={initialValues}
|
|
193
|
-
validateOnMount
|
|
194
|
-
validationSchema={getValidationSchema(t, !isInOcm)}
|
|
195
|
-
onSubmit={async (values) => {
|
|
196
|
-
clearAlerts();
|
|
197
|
-
if (!cluster?.id) {
|
|
198
|
-
addAlert({
|
|
199
|
-
title: t('ai:Missing cluster'),
|
|
200
|
-
message: t('ai:Cluster must be created before configuring infrastructure environment'),
|
|
201
|
-
variant: AlertVariant.danger,
|
|
202
|
-
});
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const commonParams = buildInfraEnvParams(values);
|
|
207
|
-
// Default pull secret only exists in OCM; when !isInOcm the user must provide it via the field
|
|
208
|
-
const pullSecretToUse = isInOcm ? defaultPullSecret : values.pullSecret;
|
|
209
|
-
|
|
210
|
-
try {
|
|
211
|
-
if (disconnectedInfraEnv?.id) {
|
|
212
|
-
// Update existing infraEnv
|
|
213
|
-
const updateParams: InfraEnvUpdateParams = {
|
|
214
|
-
...commonParams,
|
|
215
|
-
imageType: DISCONNECTED_IMAGE_TYPE,
|
|
216
|
-
pullSecret: pullSecretToUse,
|
|
217
|
-
};
|
|
218
|
-
const { data: updatedInfraEnv } = await InfraEnvsAPI.update(
|
|
219
|
-
disconnectedInfraEnv.id,
|
|
220
|
-
updateParams,
|
|
221
|
-
);
|
|
222
|
-
setDisconnectedInfraEnv({
|
|
223
|
-
...updatedInfraEnv,
|
|
224
|
-
// infraEnv does not return the whole OCP version
|
|
225
|
-
openshiftVersion: cluster.openshiftVersion,
|
|
226
|
-
});
|
|
227
|
-
} else {
|
|
228
|
-
// Create new infraEnv
|
|
229
|
-
const createParams: InfraEnvCreateParams = {
|
|
230
|
-
name: InfraEnvsService.makeInfraEnvName(DEFAULT_CPU_ARCHITECTURE, cluster.name),
|
|
231
|
-
clusterId: cluster.id,
|
|
232
|
-
openshiftVersion: cluster.openshiftVersion,
|
|
233
|
-
cpuArchitecture: DEFAULT_CPU_ARCHITECTURE,
|
|
234
|
-
imageType: DISCONNECTED_IMAGE_TYPE,
|
|
235
|
-
pullSecret: pullSecretToUse ?? '',
|
|
236
|
-
...commonParams,
|
|
237
|
-
};
|
|
238
|
-
const createdInfraEnv = await InfraEnvsService.create(createParams);
|
|
239
|
-
setDisconnectedInfraEnv({
|
|
240
|
-
...createdInfraEnv,
|
|
241
|
-
// infraEnv does not return the whole OCP version
|
|
242
|
-
openshiftVersion: cluster.openshiftVersion,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
moveNext();
|
|
246
|
-
} catch (error) {
|
|
247
|
-
handleApiError(error, () => {
|
|
248
|
-
addAlert({
|
|
249
|
-
title: disconnectedInfraEnv?.id
|
|
250
|
-
? t('ai:Failed to update infrastructure environment')
|
|
251
|
-
: t('ai:Failed to create infrastructure environment'),
|
|
252
|
-
message: getApiErrorMessage(error),
|
|
253
|
-
variant: AlertVariant.danger,
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}}
|
|
258
|
-
>
|
|
259
|
-
{({ submitForm, isValid, errors, touched, isSubmitting, values }) => {
|
|
260
|
-
const errorFields = getFormikErrorFields(errors, touched);
|
|
261
|
-
const handleNext = () => {
|
|
262
|
-
void submitForm(); // This will trigger onSubmit
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
return (
|
|
266
|
-
<ClusterWizardStep
|
|
267
|
-
navigation={<ClusterWizardNavigation />}
|
|
268
|
-
footer={
|
|
269
|
-
<ClusterWizardFooter
|
|
270
|
-
disconnectedClusterId={clusterId}
|
|
271
|
-
onNext={handleNext} // Changed from moveNext
|
|
272
|
-
onBack={moveBack}
|
|
273
|
-
isNextDisabled={!isValid || !cluster}
|
|
274
|
-
errorFields={errorFields}
|
|
275
|
-
isSubmitting={isSubmitting}
|
|
276
|
-
/>
|
|
277
|
-
}
|
|
278
|
-
>
|
|
279
|
-
<WithErrorBoundary title="Failed to load Optional Configurations step">
|
|
280
|
-
<Grid hasGutter>
|
|
281
|
-
<GridItem>
|
|
282
|
-
<Split>
|
|
283
|
-
<SplitItem>
|
|
284
|
-
<Content component="h2">{t('ai:Optional configurations')}</Content>
|
|
285
|
-
</SplitItem>
|
|
286
|
-
<SplitItem>
|
|
287
|
-
<TechnologyPreview />
|
|
288
|
-
</SplitItem>
|
|
289
|
-
</Split>
|
|
290
|
-
</GridItem>
|
|
291
|
-
<GridItem>
|
|
292
|
-
<Form id="wizard-cluster-optional-configurations__form">
|
|
293
|
-
{/* Pull secret (!OCM only) */}
|
|
294
|
-
{!isInOcm && <PullSecret defaultPullSecret={defaultPullSecret} isOcm={false} />}
|
|
295
|
-
|
|
296
|
-
{/* Rendezvous IP */}
|
|
297
|
-
<InputField
|
|
298
|
-
label={t('ai:Rendezvous IP')}
|
|
299
|
-
name="rendezvousIp"
|
|
300
|
-
helperText={t(
|
|
301
|
-
'ai:The IP address that hosts will use to communicate with the bootstrap node during installation.',
|
|
302
|
-
)}
|
|
303
|
-
placeholder="e.g., 192.168.1.10"
|
|
304
|
-
maxLength={45}
|
|
305
|
-
/>
|
|
306
|
-
|
|
307
|
-
<UploadSSH />
|
|
308
|
-
|
|
309
|
-
{/* Proxy Settings */}
|
|
310
|
-
<CheckboxField
|
|
311
|
-
label={t('ai:Configure proxy settings')}
|
|
312
|
-
name="enableProxy"
|
|
313
|
-
helperText={
|
|
314
|
-
<p>
|
|
315
|
-
{t(
|
|
316
|
-
'ai:If hosts are behind a firewall that requires the use of a proxy, provide additional information about the proxy.',
|
|
317
|
-
)}
|
|
318
|
-
</p>
|
|
319
|
-
}
|
|
320
|
-
body={values.enableProxy && <ProxyInputFields />}
|
|
321
|
-
/>
|
|
322
|
-
|
|
323
|
-
{/* NTP Configuration */}
|
|
324
|
-
<CheckboxField
|
|
325
|
-
label={t('ai:Add your own NTP (Network Time Protocol) sources')}
|
|
326
|
-
name="enableNtpSources"
|
|
327
|
-
helperText={
|
|
328
|
-
<p>
|
|
329
|
-
{t(
|
|
330
|
-
'ai:Configure your own NTP sources to synchronize the time between the hosts that will be added to this infrastructure environment.',
|
|
331
|
-
)}
|
|
332
|
-
</p>
|
|
333
|
-
}
|
|
334
|
-
body={
|
|
335
|
-
values.enableNtpSources && (
|
|
336
|
-
<Grid hasGutter>
|
|
337
|
-
<AdditionalNTPSourcesField
|
|
338
|
-
name="additionalNtpSources"
|
|
339
|
-
helperText={t(
|
|
340
|
-
'ai:A comma separated list of IP or domain names of the NTP pools or servers.',
|
|
341
|
-
)}
|
|
342
|
-
/>
|
|
343
|
-
</Grid>
|
|
344
|
-
)
|
|
345
|
-
}
|
|
346
|
-
/>
|
|
347
|
-
|
|
348
|
-
{/* Network Configuration */}
|
|
349
|
-
<HostsNetworkConfigurationControlGroup
|
|
350
|
-
clusterExists={false}
|
|
351
|
-
isDisabled={false}
|
|
352
|
-
/>
|
|
353
|
-
</Form>
|
|
354
|
-
</GridItem>
|
|
355
|
-
</Grid>
|
|
356
|
-
</WithErrorBoundary>
|
|
357
|
-
</ClusterWizardStep>
|
|
358
|
-
);
|
|
359
|
-
}}
|
|
360
|
-
</Formik>
|
|
361
|
-
);
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
export default OptionalConfigurationsStep;
|