CreateImageWizard: package search through correct architecture

Instead of always searching through x86 repos, search through the repos
of the selected architecture. This fixes HMS-3066.
This commit is contained in:
Sanne Raymaekers 2023-11-21 13:49:46 +01:00 committed by Klara Simickova
parent e60afdbe27
commit 6739851897

View file

@ -63,6 +63,7 @@ const ExactMatch = ({
export const RedHatPackages = ({ defaultArch }) => {
const { getState } = useFormApi();
const distribution = getState()?.values?.release;
const arch = getState()?.values?.arch;
const { data: distributionInformation, isSuccess: isSuccessDistroInfo } =
useGetArchitecturesQuery({ distribution });
@ -70,12 +71,10 @@ export const RedHatPackages = ({ defaultArch }) => {
// if the env is stage beta then use content-sources api
// else use image-builder api
if (getState()?.values?.contentSourcesEnabled) {
const filteredArchx86_64 = distributionInformation.find(
(info) => info.arch === 'x86_64'
);
const repoUrls = filteredArchx86_64.repositories.map(
(repo) => repo.baseurl
const filteredByArch = distributionInformation.find(
(info) => info.arch === arch
);
const repoUrls = filteredByArch.repositories.map((repo) => repo.baseurl);
return await api.getPackagesContentSources(repoUrls, packagesSearchName);
} else {
const args = [