CreateImageWizard: use content sources in production beta

Enables package searching and custom repositories.
This commit is contained in:
Sanne Raymaekers 2023-01-25 10:03:31 +01:00 committed by Lucas Garfield
parent 6131dafe48
commit a25ec459d8
3 changed files with 5 additions and 5 deletions

View file

@ -242,7 +242,7 @@ const getPackageDescription = async (release, arch, repoUrls, packageName) => {
let pack; let pack;
// if the env is stage beta then use content-sources api // if the env is stage beta then use content-sources api
// else use image-builder api // else use image-builder api
if (!insights.chrome.isProd() && insights.chrome.isBeta()) { if (insights.chrome.isBeta()) {
const data = await api.getPackagesContentSources(repoUrls, packageName); const data = await api.getPackagesContentSources(repoUrls, packageName);
pack = data.find((pack) => packageName === pack.name); pack = data.find((pack) => packageName === pack.name);
} else { } else {
@ -440,7 +440,7 @@ const formStepHistory = (composeRequest) => {
steps.push('registration'); steps.push('registration');
} }
if (!insights.chrome.isProd() && insights.chrome.isBeta()) { if (insights.chrome.isBeta()) {
steps.push('File system configuration', 'packages', 'repositories'); steps.push('File system configuration', 'packages', 'repositories');
const customRepositories = const customRepositories =
@ -472,7 +472,7 @@ const CreateImageWizard = () => {
const handleClose = () => navigate(resolveRelPath('')); const handleClose = () => navigate(resolveRelPath(''));
useEffect(() => { useEffect(() => {
if (!insights.chrome.isProd() && insights.chrome.isBeta()) { if (insights.chrome.isBeta()) {
dispatch(fetchRepositories()); dispatch(fetchRepositories());
} }
}, []); }, []);

View file

@ -34,7 +34,7 @@ export const RedHatPackages = ({ defaultArch }) => {
const getAllPackages = async (packagesSearchName) => { const getAllPackages = async (packagesSearchName) => {
// if the env is stage beta then use content-sources api // if the env is stage beta then use content-sources api
// else use image-builder api // else use image-builder api
if (!insights.chrome.isProd() && insights.chrome.isBeta()) { if (insights.chrome.isBeta()) {
const distribution = getState()?.values?.release; const distribution = getState()?.values?.release;
const repoUrls = repos[distribution].map((repo) => repo.url); const repoUrls = repos[distribution].map((repo) => repo.url);
return await api.getPackagesContentSources(repoUrls, packagesSearchName); return await api.getPackagesContentSources(repoUrls, packagesSearchName);

View file

@ -14,7 +14,7 @@ export default {
name: 'packages', name: 'packages',
substepOf: 'Content', substepOf: 'Content',
nextStep: () => { nextStep: () => {
if (!insights.chrome.isProd() && insights.chrome.isBeta()) { if (insights.chrome.isBeta()) {
return 'repositories'; return 'repositories';
} else { } else {
return 'image-name'; return 'image-name';