@openshift-assisted/ui-lib 2.12.0-cim → 2.12.1-cim
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/cim/components/Agent/NoAgentsAlert.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/EnvironmentDetails.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts +1 -1
- package/build/@types/cim/components/InfraEnv/InfraEnvFormPage.d.ts.map +1 -1
- package/build/@types/cim/components/InfraEnv/InfraTableToolbar.d.ts.map +1 -1
- package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts +5 -0
- package/build/@types/cim/components/common/CpuArchitectureDropdown.d.ts.map +1 -0
- package/build/@types/cim/components/helpers/agentStatus.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/clusterDeployment.d.ts +1 -1
- package/build/@types/cim/components/helpers/clusterDeployment.d.ts.map +1 -1
- package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts +1 -1
- package/build/@types/cim/types/k8s/infra-env-k8s-resource.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/clusterDetailsValidation.d.ts.map +1 -1
- package/build/@types/common/components/clusterWizard/types.d.ts +1 -0
- package/build/@types/common/components/clusterWizard/types.d.ts.map +1 -1
- package/build/@types/common/components/hosts/utils.d.ts.map +1 -1
- package/build/@types/common/types/cpuArchitecture.d.ts +6 -0
- package/build/@types/common/types/cpuArchitecture.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts +1 -7
- package/build/@types/ocm/components/clusterConfiguration/CpuArchitectureDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/featureSupportLevels/featureStateUtils.d.ts.map +1 -1
- package/build/@types/ocm/store/slices/current-cluster/slice.d.ts +1 -1
- package/build/cjs/cim/components/Agent/NoAgentsAlert.js +10 -5
- package/build/cjs/cim/components/Agent/NoAgentsAlert.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +2 -2
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js +2 -1
- package/build/cjs/cim/components/InfraEnv/EnvironmentDetails.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js +2 -9
- package/build/cjs/cim/components/InfraEnv/InfraEnvFormPage.js.map +1 -1
- package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js +1 -4
- package/build/cjs/cim/components/InfraEnv/InfraTableToolbar.js.map +1 -1
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js +30 -0
- package/build/cjs/cim/components/common/CpuArchitectureDropdown.js.map +1 -0
- package/build/cjs/cim/components/helpers/agentStatus.js +5 -0
- package/build/cjs/cim/components/helpers/agentStatus.js.map +1 -1
- package/build/cjs/cim/components/helpers/clusterDeployment.js +8 -1
- package/build/cjs/cim/components/helpers/clusterDeployment.js.map +1 -1
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js +1 -0
- package/build/cjs/common/components/clusterWizard/clusterDetailsValidation.js.map +1 -1
- package/build/cjs/common/components/hosts/utils.js +1 -0
- package/build/cjs/common/components/hosts/utils.js.map +1 -1
- package/build/cjs/common/types/cpuArchitecture.js +22 -1
- package/build/cjs/common/types/cpuArchitecture.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js +5 -27
- package/build/cjs/ocm/components/clusterConfiguration/CpuArchitectureDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js +2 -4
- package/build/cjs/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js +1 -2
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js.map +1 -1
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js +1 -2
- package/build/cjs/ocm/components/featureSupportLevels/featureStateUtils.js.map +1 -1
- package/lib/cim/components/Agent/NoAgentsAlert.tsx +8 -4
- package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +3 -2
- package/lib/cim/components/InfraEnv/EnvironmentDetails.tsx +8 -2
- package/lib/cim/components/InfraEnv/InfraEnvFormPage.tsx +7 -22
- package/lib/cim/components/InfraEnv/InfraTableToolbar.tsx +1 -3
- package/lib/cim/components/common/CpuArchitectureDropdown.tsx +73 -0
- package/lib/cim/components/helpers/agentStatus.tsx +5 -0
- package/lib/cim/components/helpers/clusterDeployment.ts +8 -1
- package/lib/cim/types/k8s/infra-env-k8s-resource.ts +1 -1
- package/lib/common/components/clusterWizard/clusterDetailsValidation.ts +1 -0
- package/lib/common/components/clusterWizard/types.ts +1 -0
- package/lib/common/components/hosts/utils.ts +2 -0
- package/lib/common/types/cpuArchitecture.ts +28 -0
- package/lib/ocm/components/clusterConfiguration/CpuArchitectureDropdown.tsx +2 -33
- package/lib/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.tsx +4 -7
- package/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx +1 -1
- package/lib/ocm/components/featureSupportLevels/featureStateUtils.ts +1 -1
- package/package.json +3 -3
- package/build/@types/cim/components/ClusterDeployment/ArmCheckbox.d.ts +0 -8
- package/build/@types/cim/components/ClusterDeployment/ArmCheckbox.d.ts.map +0 -1
- package/build/cjs/cim/components/ClusterDeployment/ArmCheckbox.js +0 -44
- package/build/cjs/cim/components/ClusterDeployment/ArmCheckbox.js.map +0 -1
- package/lib/cim/components/ClusterDeployment/ArmCheckbox.tsx +0 -101
|
@@ -23,7 +23,7 @@ export type InfraEnvK8sResource = K8sResourceCommon & {
|
|
|
23
23
|
};
|
|
24
24
|
nmStateConfigLabelSelector?: Selector;
|
|
25
25
|
additionalNTPSources?: string[];
|
|
26
|
-
cpuArchitecture?: 'x86_64' | 'arm64';
|
|
26
|
+
cpuArchitecture?: 'x86_64' | 'arm64' | 's390x';
|
|
27
27
|
};
|
|
28
28
|
status?: {
|
|
29
29
|
agentLabelSelector?: Selector;
|
|
@@ -76,6 +76,7 @@ export const getClusterDetailsInitialValues = ({
|
|
|
76
76
|
diskEncryption: cluster?.diskEncryption ?? {},
|
|
77
77
|
cpuArchitecture: cluster?.cpuArchitecture || getDefaultCpuArchitecture(),
|
|
78
78
|
platform: cluster?.platform?.type || 'none',
|
|
79
|
+
userManagedNetworking: cluster?.userManagedNetworking || false,
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
82
|
|
|
@@ -211,8 +211,10 @@ export const filterByHostname = (hosts: Host[], hostnameFilter: string | undefin
|
|
|
211
211
|
|
|
212
212
|
const fuse = new Fuse(hostsWithHostname, {
|
|
213
213
|
ignoreLocation: true,
|
|
214
|
+
threshold: 0.3,
|
|
214
215
|
keys: ['hostname'],
|
|
215
216
|
});
|
|
217
|
+
|
|
216
218
|
return fuse.search(hostnameFilter).map(({ item }) => item.host);
|
|
217
219
|
};
|
|
218
220
|
|
|
@@ -2,6 +2,12 @@ import { ArchitectureSupportLevelId } from '@openshift-assisted/types/assisted-i
|
|
|
2
2
|
|
|
3
3
|
export type ClusterCpuArchitecture = 'x86_64' | 'aarch64' | 'arm64' | 'ppc64le' | 's390x' | 'multi';
|
|
4
4
|
|
|
5
|
+
export type CpuArchitectureItem = {
|
|
6
|
+
description: string;
|
|
7
|
+
featureSupportLevelId?: ArchitectureSupportLevelId;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
5
11
|
export enum CpuArchitecture {
|
|
6
12
|
x86 = 'x86_64',
|
|
7
13
|
ARM = 'arm64',
|
|
@@ -43,6 +49,28 @@ export const getAllCpuArchitectures = (): SupportedCpuArchitecture[] => [
|
|
|
43
49
|
CpuArchitecture.s390x,
|
|
44
50
|
];
|
|
45
51
|
|
|
52
|
+
export const architectureData: Record<SupportedCpuArchitecture, CpuArchitectureItem> = {
|
|
53
|
+
[CpuArchitecture.x86]: {
|
|
54
|
+
description: '',
|
|
55
|
+
label: 'x86_64',
|
|
56
|
+
},
|
|
57
|
+
[CpuArchitecture.ARM]: {
|
|
58
|
+
description: 'Some features may not be available',
|
|
59
|
+
featureSupportLevelId: 'ARM64_ARCHITECTURE',
|
|
60
|
+
label: 'Arm64',
|
|
61
|
+
},
|
|
62
|
+
[CpuArchitecture.ppc64le]: {
|
|
63
|
+
description: 'Some features may not be available',
|
|
64
|
+
featureSupportLevelId: 'PPC64LE_ARCHITECTURE',
|
|
65
|
+
label: 'IBM Power (ppc64le)',
|
|
66
|
+
},
|
|
67
|
+
[CpuArchitecture.s390x]: {
|
|
68
|
+
description: 'Some features may not be available',
|
|
69
|
+
featureSupportLevelId: 'S390X_ARCHITECTURE',
|
|
70
|
+
label: 'IBM Z (s390x)',
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
46
74
|
export const getSupportedCpuArchitectures = (
|
|
47
75
|
cpuArchitectures: CpuArchitecture[],
|
|
48
76
|
day1CpuArchitecture?: SupportedCpuArchitecture,
|
|
@@ -11,17 +11,14 @@ import {
|
|
|
11
11
|
import { CaretDownIcon } from '@patternfly/react-icons/dist/js/icons/caret-down-icon';
|
|
12
12
|
import { useField } from 'formik';
|
|
13
13
|
import {
|
|
14
|
+
architectureData,
|
|
14
15
|
CpuArchitecture,
|
|
15
16
|
FeatureId,
|
|
16
17
|
getDefaultCpuArchitecture,
|
|
17
18
|
getFieldId,
|
|
18
19
|
SupportedCpuArchitecture,
|
|
19
20
|
} from '../../../common';
|
|
20
|
-
import {
|
|
21
|
-
ArchitectureSupportLevelId,
|
|
22
|
-
Cluster,
|
|
23
|
-
PlatformType,
|
|
24
|
-
} from '@openshift-assisted/types/assisted-installer-service';
|
|
21
|
+
import { Cluster, PlatformType } from '@openshift-assisted/types/assisted-installer-service';
|
|
25
22
|
import {
|
|
26
23
|
NewFeatureSupportLevelMap,
|
|
27
24
|
useNewFeatureSupportLevel,
|
|
@@ -29,34 +26,6 @@ import {
|
|
|
29
26
|
import useSupportLevelsAPI from '../../hooks/useSupportLevelsAPI';
|
|
30
27
|
import { ExternalPlaformIds, ExternalPlatformLabels } from './platformIntegration/constants';
|
|
31
28
|
|
|
32
|
-
export type CpuArchitectureItem = {
|
|
33
|
-
description: string;
|
|
34
|
-
featureSupportLevelId?: ArchitectureSupportLevelId;
|
|
35
|
-
label: string;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const architectureData: Record<SupportedCpuArchitecture, CpuArchitectureItem> = {
|
|
39
|
-
[CpuArchitecture.x86]: {
|
|
40
|
-
description: '',
|
|
41
|
-
label: 'x86_64',
|
|
42
|
-
},
|
|
43
|
-
[CpuArchitecture.ARM]: {
|
|
44
|
-
description: 'Some features may not be available',
|
|
45
|
-
featureSupportLevelId: 'ARM64_ARCHITECTURE',
|
|
46
|
-
label: 'Arm64',
|
|
47
|
-
},
|
|
48
|
-
[CpuArchitecture.ppc64le]: {
|
|
49
|
-
description: 'Some features may not be available',
|
|
50
|
-
featureSupportLevelId: 'PPC64LE_ARCHITECTURE',
|
|
51
|
-
label: 'IBM Power (ppc64le)',
|
|
52
|
-
},
|
|
53
|
-
[CpuArchitecture.s390x]: {
|
|
54
|
-
description: 'Some features may not be available',
|
|
55
|
-
featureSupportLevelId: 'S390X_ARCHITECTURE',
|
|
56
|
-
label: 'IBM Z (s390x)',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
29
|
const INPUT_NAME = 'cpuArchitecture';
|
|
61
30
|
const fieldId = getFieldId(INPUT_NAME, 'input');
|
|
62
31
|
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
StaticTextField,
|
|
15
15
|
getSupportedCpuArchitectures,
|
|
16
16
|
SupportedCpuArchitecture,
|
|
17
|
+
architectureData,
|
|
17
18
|
} from '../../../common';
|
|
18
19
|
import DiskEncryptionControlGroup from '../../../common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup';
|
|
19
20
|
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
@@ -21,10 +22,7 @@ import { OcmRichInputField } from '../ui/OcmFormFields';
|
|
|
21
22
|
import OcmOpenShiftVersion from './OcmOpenShiftVersion';
|
|
22
23
|
import OcmOpenShiftVersionSelect from './OcmOpenShiftVersionSelect';
|
|
23
24
|
import CustomManifestCheckbox from './CustomManifestCheckbox';
|
|
24
|
-
import CpuArchitectureDropdown
|
|
25
|
-
architectureData,
|
|
26
|
-
CpuArchitectureItem,
|
|
27
|
-
} from './CpuArchitectureDropdown';
|
|
25
|
+
import CpuArchitectureDropdown from './CpuArchitectureDropdown';
|
|
28
26
|
import { OcmBaseDomainField } from './OcmBaseDomainField';
|
|
29
27
|
import OcmSNOControlGroup from './OcmSNOControlGroup';
|
|
30
28
|
import useSupportLevelsAPI from '../../hooks/useSupportLevelsAPI';
|
|
@@ -80,9 +78,8 @@ export const OcmClusterDetailsFormFields = ({
|
|
|
80
78
|
() => getSupportedCpuArchitectures(cpuArchitecturesByVersionImage),
|
|
81
79
|
[cpuArchitecturesByVersionImage],
|
|
82
80
|
);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const cpuArchitecture = (architectureData[values.cpuArchitecture] as CpuArchitectureItem).label;
|
|
81
|
+
const cpuArchitecture =
|
|
82
|
+
architectureData[values.cpuArchitecture as SupportedCpuArchitecture].label;
|
|
86
83
|
|
|
87
84
|
const featureSupportLevelContext = useNewFeatureSupportLevel();
|
|
88
85
|
|
package/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
CpuArchitecture,
|
|
17
17
|
FeatureId,
|
|
18
18
|
SupportedCpuArchitecture,
|
|
19
|
+
architectureData,
|
|
19
20
|
getFieldId,
|
|
20
21
|
} from '../../../../common';
|
|
21
22
|
import { ExternalPlaformIds, ExternalPlatformLabels, ExternalPlatformLinks } from './constants';
|
|
@@ -25,7 +26,6 @@ import {
|
|
|
25
26
|
NewFeatureSupportLevelMap,
|
|
26
27
|
useNewFeatureSupportLevel,
|
|
27
28
|
} from '../../../../common/components/newFeatureSupportLevels';
|
|
28
|
-
import { architectureData } from '../CpuArchitectureDropdown';
|
|
29
29
|
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge';
|
|
30
30
|
|
|
31
31
|
const INPUT_NAME = 'platform';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ActiveFeatureConfiguration,
|
|
3
|
+
architectureData,
|
|
3
4
|
CpuArchitecture,
|
|
4
5
|
FeatureId,
|
|
5
6
|
isSNO,
|
|
6
7
|
OperatorsValues,
|
|
7
8
|
SupportedCpuArchitecture,
|
|
8
9
|
} from '../../../common';
|
|
9
|
-
import { architectureData } from '../clusterConfiguration/CpuArchitectureDropdown';
|
|
10
10
|
import {
|
|
11
11
|
Cluster,
|
|
12
12
|
PlatformType,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@openshift-assisted/locales": "2.12.
|
|
4
|
-
"@openshift-assisted/types": "2.12.
|
|
3
|
+
"@openshift-assisted/locales": "2.12.1-cim",
|
|
4
|
+
"@openshift-assisted/types": "2.12.1-cim",
|
|
5
5
|
"@openshift-console/dynamic-plugin-sdk": "0.0.3",
|
|
6
6
|
"@patternfly/patternfly": "^4.222.4",
|
|
7
7
|
"@patternfly/react-code-editor": "^4.82.113",
|
|
@@ -141,5 +141,5 @@
|
|
|
141
141
|
]
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
-
"version": "2.12.
|
|
144
|
+
"version": "2.12.1-cim"
|
|
145
145
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { OpenshiftVersionOptionType } from '../../../common';
|
|
3
|
-
type ArmCheckboxProps = {
|
|
4
|
-
versions: OpenshiftVersionOptionType[];
|
|
5
|
-
};
|
|
6
|
-
declare const ArmCheckbox: React.FC<ArmCheckboxProps>;
|
|
7
|
-
export default ArmCheckbox;
|
|
8
|
-
//# sourceMappingURL=ArmCheckbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArmCheckbox.d.ts","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ArmCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAIL,0BAA0B,EAE3B,MAAM,iBAAiB,CAAC;AA4BzB,KAAK,gBAAgB,GAAG;IAAE,QAAQ,EAAE,0BAA0B,EAAE,CAAA;CAAE,CAAC;AAEnE,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2D3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,44 +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 react_core_1 = require("@patternfly/react-core");
|
|
6
|
-
const formik_1 = require("formik");
|
|
7
|
-
const common_1 = require("../../../common");
|
|
8
|
-
const featureSupportLevels_1 = require("../../../common/components/featureSupportLevels");
|
|
9
|
-
const use_translation_wrapper_1 = require("../../../common/hooks/use-translation-wrapper");
|
|
10
|
-
const Label = ({ version }) => {
|
|
11
|
-
const { t } = (0, use_translation_wrapper_1.useTranslation)();
|
|
12
|
-
return (React.createElement(React.Fragment, null,
|
|
13
|
-
t('ai:Use arm64 CPU architecture'),
|
|
14
|
-
' ',
|
|
15
|
-
React.createElement(common_1.PopoverIcon, { noVerticalAlign: true, bodyContent: React.createElement("p", null, t('ai:Check this option if you want to use the arm64 CPU architecture instead of the default x86_64 CPU architecture. Please note that some features will not be available.')) }),
|
|
16
|
-
React.createElement(featureSupportLevels_1.FeatureSupportLevelBadge, { featureId: "ARM64_ARCHITECTURE", openshiftVersion: version })));
|
|
17
|
-
};
|
|
18
|
-
const ArmCheckbox = ({ versions }) => {
|
|
19
|
-
const { t } = (0, use_translation_wrapper_1.useTranslation)();
|
|
20
|
-
const { values: { openshiftVersion }, } = (0, formik_1.useFormikContext)();
|
|
21
|
-
const [{ name, value }, , { setValue }] = (0, formik_1.useField)('cpuArchitecture');
|
|
22
|
-
const fieldId = (0, common_1.getFieldId)(name, 'input');
|
|
23
|
-
const featureSupportLevelContext = (0, featureSupportLevels_1.useFeatureSupportLevel)();
|
|
24
|
-
const isSupportedVersionAvailable = !!versions.find((version) => featureSupportLevelContext.isFeatureSupported(version.value, 'ARM64_ARCHITECTURE'));
|
|
25
|
-
const prevVersionRef = React.useRef(openshiftVersion);
|
|
26
|
-
const handleChange = React.useCallback((checked) => setValue(checked ? common_1.CpuArchitecture.ARM : common_1.CpuArchitecture.x86), [setValue]);
|
|
27
|
-
React.useEffect(() => {
|
|
28
|
-
if (prevVersionRef.current !== openshiftVersion &&
|
|
29
|
-
!featureSupportLevelContext.isFeatureSupported(openshiftVersion, 'ARM64_ARCHITECTURE')) {
|
|
30
|
-
//invoke updating cpu architecture value only if the version changed to not be in danger of touching existing clusters
|
|
31
|
-
handleChange(false);
|
|
32
|
-
}
|
|
33
|
-
prevVersionRef.current = openshiftVersion;
|
|
34
|
-
}, [openshiftVersion, handleChange, featureSupportLevelContext]);
|
|
35
|
-
if (!isSupportedVersionAvailable) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const disabledReason = featureSupportLevelContext.getFeatureDisabledReason(openshiftVersion, 'ARM64_ARCHITECTURE');
|
|
39
|
-
return (React.createElement(react_core_1.FormGroup, { isInline: true, fieldId: fieldId },
|
|
40
|
-
React.createElement(react_core_1.Tooltip, { hidden: !disabledReason, content: disabledReason },
|
|
41
|
-
React.createElement(react_core_1.Checkbox, { id: fieldId, name: name, isDisabled: featureSupportLevelContext.isFeatureDisabled(openshiftVersion, 'ARM64_ARCHITECTURE'), label: React.createElement(Label, { version: openshiftVersion }), "aria-describedby": `${fieldId}-helper`, description: React.createElement(common_1.HelperText, { fieldId: fieldId }, t('ai:Make sure all the hosts are using arm64 CPU architecture.')), isChecked: value === common_1.CpuArchitecture.ARM, onChange: handleChange }))));
|
|
42
|
-
};
|
|
43
|
-
exports.default = ArmCheckbox;
|
|
44
|
-
//# sourceMappingURL=ArmCheckbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArmCheckbox.js","sourceRoot":"","sources":["../../../../../lib/cim/components/ClusterDeployment/ArmCheckbox.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Checkbox, FormGroup, Tooltip } from '@patternfly/react-core';
|
|
3
|
-
import { useField, useFormikContext } from 'formik';
|
|
4
|
-
import {
|
|
5
|
-
CpuArchitecture,
|
|
6
|
-
getFieldId,
|
|
7
|
-
HelperText,
|
|
8
|
-
OpenshiftVersionOptionType,
|
|
9
|
-
PopoverIcon,
|
|
10
|
-
} from '../../../common';
|
|
11
|
-
import {
|
|
12
|
-
FeatureSupportLevelBadge,
|
|
13
|
-
useFeatureSupportLevel,
|
|
14
|
-
} from '../../../common/components/featureSupportLevels';
|
|
15
|
-
import { useTranslation } from '../../../common/hooks/use-translation-wrapper';
|
|
16
|
-
import { ClusterCreateParams } from '@openshift-assisted/types/assisted-installer-service';
|
|
17
|
-
|
|
18
|
-
const Label = ({ version }: { version: string }) => {
|
|
19
|
-
const { t } = useTranslation();
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
{t('ai:Use arm64 CPU architecture')}{' '}
|
|
23
|
-
<PopoverIcon
|
|
24
|
-
noVerticalAlign
|
|
25
|
-
bodyContent={
|
|
26
|
-
<p>
|
|
27
|
-
{t(
|
|
28
|
-
'ai:Check this option if you want to use the arm64 CPU architecture instead of the default x86_64 CPU architecture. Please note that some features will not be available.',
|
|
29
|
-
)}
|
|
30
|
-
</p>
|
|
31
|
-
}
|
|
32
|
-
/>
|
|
33
|
-
<FeatureSupportLevelBadge featureId="ARM64_ARCHITECTURE" openshiftVersion={version} />
|
|
34
|
-
</>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
type ArmCheckboxProps = { versions: OpenshiftVersionOptionType[] };
|
|
39
|
-
|
|
40
|
-
const ArmCheckbox: React.FC<ArmCheckboxProps> = ({ versions }) => {
|
|
41
|
-
const { t } = useTranslation();
|
|
42
|
-
const {
|
|
43
|
-
values: { openshiftVersion },
|
|
44
|
-
} = useFormikContext<ClusterCreateParams>();
|
|
45
|
-
const [{ name, value }, , { setValue }] = useField<CpuArchitecture>('cpuArchitecture');
|
|
46
|
-
const fieldId = getFieldId(name, 'input');
|
|
47
|
-
|
|
48
|
-
const featureSupportLevelContext = useFeatureSupportLevel();
|
|
49
|
-
const isSupportedVersionAvailable = !!versions.find((version) =>
|
|
50
|
-
featureSupportLevelContext.isFeatureSupported(version.value, 'ARM64_ARCHITECTURE'),
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
const prevVersionRef = React.useRef(openshiftVersion);
|
|
54
|
-
const handleChange = React.useCallback(
|
|
55
|
-
(checked: boolean) => setValue(checked ? CpuArchitecture.ARM : CpuArchitecture.x86),
|
|
56
|
-
[setValue],
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
React.useEffect(() => {
|
|
60
|
-
if (
|
|
61
|
-
prevVersionRef.current !== openshiftVersion &&
|
|
62
|
-
!featureSupportLevelContext.isFeatureSupported(openshiftVersion, 'ARM64_ARCHITECTURE')
|
|
63
|
-
) {
|
|
64
|
-
//invoke updating cpu architecture value only if the version changed to not be in danger of touching existing clusters
|
|
65
|
-
handleChange(false);
|
|
66
|
-
}
|
|
67
|
-
prevVersionRef.current = openshiftVersion;
|
|
68
|
-
}, [openshiftVersion, handleChange, featureSupportLevelContext]);
|
|
69
|
-
if (!isSupportedVersionAvailable) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
const disabledReason = featureSupportLevelContext.getFeatureDisabledReason(
|
|
73
|
-
openshiftVersion,
|
|
74
|
-
'ARM64_ARCHITECTURE',
|
|
75
|
-
);
|
|
76
|
-
return (
|
|
77
|
-
<FormGroup isInline fieldId={fieldId}>
|
|
78
|
-
<Tooltip hidden={!disabledReason} content={disabledReason}>
|
|
79
|
-
<Checkbox
|
|
80
|
-
id={fieldId}
|
|
81
|
-
name={name}
|
|
82
|
-
isDisabled={featureSupportLevelContext.isFeatureDisabled(
|
|
83
|
-
openshiftVersion,
|
|
84
|
-
'ARM64_ARCHITECTURE',
|
|
85
|
-
)}
|
|
86
|
-
label={<Label version={openshiftVersion} />}
|
|
87
|
-
aria-describedby={`${fieldId}-helper`}
|
|
88
|
-
description={
|
|
89
|
-
<HelperText fieldId={fieldId}>
|
|
90
|
-
{t('ai:Make sure all the hosts are using arm64 CPU architecture.')}
|
|
91
|
-
</HelperText>
|
|
92
|
-
}
|
|
93
|
-
isChecked={value === CpuArchitecture.ARM}
|
|
94
|
-
onChange={handleChange}
|
|
95
|
-
/>
|
|
96
|
-
</Tooltip>
|
|
97
|
-
</FormGroup>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export default ArmCheckbox;
|