Wizard: add EPEL 10 support

This adds support for EPEL 10 repository. Changes the way of getting
the correct EPEL version for RHEL distribution to be more future proof.
This commit is contained in:
Dominik Vagner 2025-06-27 10:44:14 +02:00 committed by Klara Simickova
parent 12024b08c6
commit e05079330b
4 changed files with 102 additions and 15 deletions

View file

@ -60,8 +60,7 @@ import {
import {
CONTENT_URL,
ContentOrigin,
EPEL_8_REPO_DEFINITION,
EPEL_9_REPO_DEFINITION,
EPEL_10_REPO_DEFINITION,
} from '../../../../constants';
import { useGetArchitecturesQuery } from '../../../../store/backendApi';
import {
@ -92,6 +91,11 @@ import {
removeModule,
selectModules,
} from '../../../../store/wizardSlice';
import {
getEpelDefinitionForDistribution,
getEpelUrlForDistribution,
getEpelVersionForDistribution,
} from '../../../../Utilities/epel';
import useDebounce from '../../../../Utilities/useDebounce';
export type PackageRepository = 'distro' | 'custom' | 'recommended' | '';
@ -141,11 +145,8 @@ const Packages = () => {
distribution: distribution,
});
// select the correct version of EPEL repository
// the urls are copied over from the content service
const epelRepoUrlByDistribution = distribution.startsWith('rhel-8')
? EPEL_8_REPO_DEFINITION.url
: EPEL_9_REPO_DEFINITION.url;
const epelRepoUrlByDistribution =
getEpelUrlForDistribution(distribution) ?? EPEL_10_REPO_DEFINITION.url;
const { data: epelRepo, isSuccess: isSuccessEpelRepo } =
useListRepositoriesQuery({
@ -597,7 +598,8 @@ const Packages = () => {
<Td>{isSelectingGroup?.name}</Td>
)}
<Td>
EPEL {distribution === 'rhel-8' ? '8' : '9'} Everything x86_64
EPEL {getEpelVersionForDistribution(distribution)} Everything
x86_64
</Td>
</Tr>
</Tbody>
@ -919,9 +921,9 @@ const Packages = () => {
if (epelRepo.data.length === 0) {
const result = await createRepository({
apiRepositoryRequest: distribution.startsWith('rhel-8')
? EPEL_8_REPO_DEFINITION
: EPEL_9_REPO_DEFINITION,
apiRepositoryRequest:
getEpelDefinitionForDistribution(distribution) ??
EPEL_10_REPO_DEFINITION,
});
dispatch(
addRecommendedRepository(
@ -1242,7 +1244,7 @@ const Packages = () => {
<Icon status="warning">
<OptimizeIcon />
</Icon>{' '}
EPEL {distribution.startsWith('rhel-8') ? '8' : '9'}{' '}
EPEL {getEpelVersionForDistribution(distribution)}{' '}
Everything x86_64
</Td>
</>
@ -1329,7 +1331,7 @@ const Packages = () => {
<Icon status="warning">
<OptimizeIcon />
</Icon>{' '}
EPEL {distribution.startsWith('rhel-8') ? '8' : '9'}{' '}
EPEL {getEpelVersionForDistribution(distribution)}{' '}
Everything x86_64
</Td>
</>

View file

@ -25,6 +25,7 @@ import {
selectRecommendedRepositories,
selectTemplate,
} from '../../../../store/wizardSlice';
import { getEpelVersionForDistribution } from '../../../../Utilities/epel';
import PackageInfoNotAvailablePopover from '../Packages/components/PackageInfoNotAvailablePopover';
type repoPropType = {
@ -284,8 +285,8 @@ export const RepositoriesTable = () => {
{recommendedRepositoriesList.length > 0 && (
<Tr key={0}>
<Td className="pf-m-width-60">
EPEL {distribution.startsWith('rhel-8') ? '8' : '9'}{' '}
Everything x86_64
EPEL {getEpelVersionForDistribution(distribution)} Everything
x86_64
</Td>
</Tr>
)}