@openshift-assisted/ui-lib 2.15.3-cim → 2.15.5-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/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts +0 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/HostedClusterWizard/HostsStep/NodePoolForm.d.ts.map +1 -1
- package/build/@types/cim/components/Hypershift/forms/NodePoolAgentsForm.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
- package/build/@types/common/api/assisted-service/BundleAPI.d.ts +2 -2
- package/build/@types/common/api/assisted-service/ClustersAPI.d.ts +25 -25
- package/build/@types/common/api/assisted-service/ComponentVersionsAPI.d.ts +1 -1
- package/build/@types/common/api/assisted-service/EventsAPI.d.ts +1 -1
- package/build/@types/common/api/assisted-service/HostsAPI.d.ts +6 -6
- package/build/@types/common/api/assisted-service/InfraEnvsAPI.d.ts +7 -7
- package/build/@types/common/api/assisted-service/ManagedDomainsAPI.d.ts +1 -1
- package/build/@types/common/api/assisted-service/NewFeatureSupportLevelsAPI.d.ts +2 -2
- package/build/@types/common/api/assisted-service/OperatorsAPI.d.ts +1 -1
- package/build/@types/common/api/assisted-service/SupportedOpenshiftVersionsAPI.d.ts +1 -1
- package/build/@types/common/api/assisted-service/UISettingsAPI.d.ts +2 -2
- package/build/@types/common/components/ui/formik/TextAreaField.d.ts.map +1 -1
- package/build/@types/ocm/services/ClustersService.d.ts +5 -5
- package/build/@types/ocm/services/HostsService.d.ts +11 -11
- package/build/@types/ocm/services/InfraEnvsService.d.ts +2 -2
- package/build/@types/ocm/services/UISettingsService.d.ts +1 -1
- package/build/@types/ocm/store/slices/infra-envs/thunks.d.ts +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +12 -17
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +7 -5
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js +2 -11
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/NodePoolForm.js +0 -28
- package/build/cjs/cim/components/Hypershift/HostedClusterWizard/HostsStep/NodePoolForm.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/forms/NodePoolAgentsForm.js +8 -3
- package/build/cjs/cim/components/Hypershift/forms/NodePoolAgentsForm.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/modals/AddNodePoolModal.js +1 -1
- package/build/cjs/cim/components/Hypershift/modals/AddNodePoolModal.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/modals/ManageHostsModal.js +2 -2
- package/build/cjs/cim/components/Hypershift/modals/ManageHostsModal.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.js +42 -27
- package/build/cjs/cim/components/helpers/versions.js.map +1 -1
- package/build/cjs/common/components/ui/formik/TextAreaField.js +2 -1
- package/build/cjs/common/components/ui/formik/TextAreaField.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +9 -19
- package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +5 -5
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.tsx +2 -13
- package/lib/cim/components/Hypershift/HostedClusterWizard/HostsStep/NodePoolForm.tsx +1 -33
- package/lib/cim/components/Hypershift/forms/NodePoolAgentsForm.tsx +24 -12
- package/lib/cim/components/Hypershift/modals/AddNodePoolModal.tsx +1 -1
- package/lib/cim/components/Hypershift/modals/ManageHostsModal.tsx +2 -2
- package/lib/cim/components/helpers/versions.ts +51 -34
- package/lib/common/components/ui/formik/TextAreaField.tsx +14 -7
- package/package.json +3 -3
|
@@ -61,48 +61,65 @@ export const isValidImageSet = (
|
|
|
61
61
|
);
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
+
// Extracts major.minor version, strips any non-numeric prefix (e.g., "img4.18.55" → "4.18")
|
|
65
|
+
const extractMajorMinor = (version: string): string => {
|
|
66
|
+
const versionWithoutPrefix = version.replace(/^[^\d]*/, '');
|
|
67
|
+
return versionWithoutPrefix.split('.').slice(0, 2).join('.');
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Converts a ClusterImageSet to an OpenshiftVersionOptionType
|
|
71
|
+
const toVersionOption = (
|
|
72
|
+
clusterImageSet: ClusterImageSetK8sResource,
|
|
73
|
+
): OpenshiftVersionOptionType => {
|
|
74
|
+
const version =
|
|
75
|
+
getVersionFromReleaseImage(clusterImageSet.spec?.releaseImage) ||
|
|
76
|
+
clusterImageSet.metadata?.name ||
|
|
77
|
+
'';
|
|
78
|
+
const cpuArch = getCPUArchFromReleaseImage(clusterImageSet.spec?.releaseImage);
|
|
79
|
+
return {
|
|
80
|
+
label: `OpenShift ${version}`,
|
|
81
|
+
version,
|
|
82
|
+
value: clusterImageSet.metadata?.name as string,
|
|
83
|
+
default: false,
|
|
84
|
+
// (rawagner) ACM does not have the warning so changing to 'production'
|
|
85
|
+
// supportLevel : getSupportLevelFromChannel(clusterImageSet.metadata?.labels?.channel)
|
|
86
|
+
supportLevel: 'production',
|
|
87
|
+
cpuArchitectures: cpuArch ? [cpuArch as CpuArchitecture] : undefined,
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* In case there are osImages specified on the AgentServiceConfig, we want to limit
|
|
93
|
+
* the availability in the dropdown to only versions that are listed there.
|
|
94
|
+
* Otherwise the installation fails.
|
|
95
|
+
*/
|
|
96
|
+
const hasMatchingOsImage = (
|
|
97
|
+
version: OpenshiftVersionOptionType,
|
|
98
|
+
osImageVersions: (string | undefined)[],
|
|
99
|
+
): boolean => {
|
|
100
|
+
if (!osImageVersions.length) return true;
|
|
101
|
+
return osImageVersions.includes(extractMajorMinor(version.version));
|
|
102
|
+
};
|
|
103
|
+
|
|
64
104
|
export const getOCPVersions = (
|
|
65
105
|
clusterImageSets: ClusterImageSetK8sResource[],
|
|
66
|
-
isNutanix?: boolean
|
|
106
|
+
isNutanix?: boolean,
|
|
67
107
|
osImages?: OsImage[],
|
|
68
108
|
extended?: boolean,
|
|
69
109
|
): OpenshiftVersionOptionType[] => {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
);
|
|
110
|
+
const architectures = isNutanix ? supportedNutanixPlatforms : undefined;
|
|
111
|
+
const osImageVersions = [...new Set(osImages?.map((img) => img.openshiftVersion))];
|
|
73
112
|
|
|
74
113
|
const versions = clusterImageSets
|
|
75
|
-
.filter((clusterImageSet) =>
|
|
76
|
-
|
|
77
|
-
)
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
label: `OpenShift ${version ? version : (clusterImageSet.metadata?.name as string)}`,
|
|
83
|
-
version: version || clusterImageSet.metadata?.name || '',
|
|
84
|
-
value: clusterImageSet.metadata?.name as string,
|
|
85
|
-
default: false,
|
|
86
|
-
// (rawagner) ACM does not have the warning so changing to 'production'
|
|
87
|
-
supportLevel: 'production', // getSupportLevelFromChannel(clusterImageSet.metadata?.labels?.channel),
|
|
88
|
-
cpuArchitectures: cpuArch ? [cpuArch as CpuArchitecture] : undefined,
|
|
89
|
-
};
|
|
90
|
-
})
|
|
91
|
-
.filter((ocpVersion) => {
|
|
92
|
-
const ver = ocpVersion.version.split('.').slice(0, 2).join('.');
|
|
93
|
-
return !!ocpImageVersions.length ? ocpImageVersions.includes(ver) : true;
|
|
94
|
-
})
|
|
95
|
-
.sort(
|
|
96
|
-
(versionA, versionB) => /* descending */ -1 * versionA.label.localeCompare(versionB.label),
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
if (versions.length) {
|
|
100
|
-
// make sure that the pre-selected one is the first-one after sorting
|
|
101
|
-
versions[0].default = true;
|
|
102
|
-
}
|
|
114
|
+
.filter((clusterImageSet) => isValidImageSet(clusterImageSet, architectures, extended))
|
|
115
|
+
.map(toVersionOption)
|
|
116
|
+
.filter((v) => hasMatchingOsImage(v, osImageVersions))
|
|
117
|
+
.sort((a, b) => b.label.localeCompare(a.label));
|
|
118
|
+
|
|
119
|
+
// Mark first version as the default selection
|
|
120
|
+
versions[0] && (versions[0].default = true);
|
|
103
121
|
|
|
104
|
-
|
|
105
|
-
return deduped;
|
|
122
|
+
return uniqBy(versions, (v) => v.version);
|
|
106
123
|
};
|
|
107
124
|
|
|
108
125
|
export const getSelectedVersion = (
|
|
@@ -60,13 +60,20 @@ const TextAreaField: React.FC<TextAreaFieldProps> = ({
|
|
|
60
60
|
{(errorMessage || helperText) && (
|
|
61
61
|
<FormHelperText>
|
|
62
62
|
<HelperText>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
{errorMessage && (
|
|
64
|
+
<HelperTextItem
|
|
65
|
+
icon={<ExclamationCircleIcon />}
|
|
66
|
+
variant={'error'}
|
|
67
|
+
id={`${fieldId}-helper-error`}
|
|
68
|
+
>
|
|
69
|
+
{errorMessage}
|
|
70
|
+
</HelperTextItem>
|
|
71
|
+
)}
|
|
72
|
+
{helperText && (
|
|
73
|
+
<HelperTextItem variant={'default'} id={`${fieldId}-helper`}>
|
|
74
|
+
{helperText}
|
|
75
|
+
</HelperTextItem>
|
|
76
|
+
)}
|
|
70
77
|
</HelperText>
|
|
71
78
|
</FormHelperText>
|
|
72
79
|
)}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@openshift-assisted/locales": "2.15.
|
|
4
|
-
"@openshift-assisted/types": "2.15.
|
|
3
|
+
"@openshift-assisted/locales": "2.15.5-cim",
|
|
4
|
+
"@openshift-assisted/types": "2.15.5-cim",
|
|
5
5
|
"@openshift-console/dynamic-plugin-sdk": "0.0.3",
|
|
6
6
|
"@patternfly/patternfly": "5.2.0",
|
|
7
7
|
"@patternfly/react-code-editor": "5.2.0",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
]
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
|
-
"version": "2.15.
|
|
143
|
+
"version": "2.15.5-cim"
|
|
144
144
|
}
|