Wizard: Add the option of building OCI images to the Wizard

This adds a tile allowing to build an OCI image to the Image output step of the wizard. The tile is only visible in the Preview.

As there are no other customer information needed for the build, no addiional step for OCI was added.

Review step was also updated to include OCI images.
This commit is contained in:
regexowl 2023-10-17 09:32:00 +02:00 committed by Klara Simickova
parent de30c6c637
commit fd61cd135b
4 changed files with 70 additions and 1 deletions

View file

@ -198,6 +198,26 @@ const onSave = (values) => {
requests.push(request);
}
if (values['target-environment']?.oci) {
const request = {
distribution: values.release,
image_name: values?.['image-name'],
image_description: values?.['image-description'],
image_requests: [
{
architecture: 'x86_64',
image_type: 'oci',
upload_request: {
type: 'oci.objectstorage',
options: {},
},
},
],
customizations,
};
requests.push(request);
}
if (values['target-environment']?.vsphere) {
const request = {
distribution: values.release,
@ -336,13 +356,17 @@ const requestToState = (composeRequest, distroInfo, isProd, enableOscap) => {
aws: false,
azure: false,
gcp: false,
oci: false,
'guest-image': false,
};
// then select the one from the request
// if the image type is to a cloud provider we use the upload_request.type
// or if the image is intended for download we use the image_type
let targetEnvironment;
if (uploadRequest.type === 'aws.s3') {
if (
uploadRequest.type === 'aws.s3' ||
uploadRequest.type === 'oci.objectstorage'
) {
targetEnvironment = imageRequest.image_type;
} else {
targetEnvironment = uploadRequest.type;

View file

@ -21,6 +21,7 @@ import {
TargetEnvAWSList,
TargetEnvAzureList,
TargetEnvGCPList,
TargetEnvOciList,
TargetEnvOtherList,
} from './ReviewStepTextLists';
@ -94,6 +95,9 @@ const ReviewStep = () => {
{getState()?.values?.['target-environment']?.azure && (
<TargetEnvAzureList />
)}
{getState()?.values?.['target-environment']?.oci && (
<TargetEnvOciList />
)}
{getState()?.values?.['target-environment']?.vsphere && (
<TextContent>
<Text component={TextVariants.h3}>VMWare vSphere (.vmdk)</Text>

View file

@ -236,6 +236,27 @@ export const TargetEnvAzureList = () => {
);
};
export const TargetEnvOciList = () => {
return (
<TextContent>
<Text component={TextVariants.h3}>Oracle Cloud Infrastructure</Text>
<TextList component={TextListVariants.dl}>
<TextListItem
component={TextListItemVariants.dt}
className="pf-u-min-width"
>
Object Storage URL
</TextListItem>
<TextListItem component={TextListItemVariants.dd}>
The URL for the built image will be ready to copy
<br />
</TextListItem>
</TextList>
<br />
</TextContent>
);
};
export const TargetEnvOtherList = () => {
return (
<>

View file

@ -52,6 +52,7 @@ const TargetEnvironment = ({ label, isRequired, ...props }) => {
aws: false,
azure: false,
gcp: false,
oci: false,
'vsphere-ova': false,
vsphere: false,
'guest-image': false,
@ -214,6 +215,25 @@ const TargetEnvironment = ({ label, isRequired, ...props }) => {
isDisplayLarge
/>
)}
{allowedTargets.includes('oci') && isBeta() && (
<Tile
className="tile pf-u-mr-sm"
data-testid="upload-oci"
title="Oracle Cloud Infrastructure"
icon={
<img
className="provider-icon"
src={'/apps/frontend-assets/partners-icons/oracle-short.svg'}
alt="Oracle Cloud Infrastructure logo"
/>
}
onClick={() => handleSetEnvironment('oci', !environment.oci)}
onKeyDown={(e) => handleKeyDown(e, 'oci', !environment.oci)}
isSelected={environment.oci}
isStacked
isDisplayLarge
/>
)}
</div>
</FormGroup>
{allowedTargets.includes('vsphere') && (