diff --git a/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx b/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx index d6475657..fe85b87b 100644 --- a/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx +++ b/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx @@ -1,3 +1,4 @@ +import { Blueprint as CloudApiBlueprint } from '../../../store/cockpit/composerCloudApi'; import { BlueprintExportResponse, Container, @@ -16,6 +17,9 @@ import { Timezone, } from '../../../store/imageBuilderApi'; +// Blueprint as defined by the osbuild-composer cloudapi's /compose +// endpoint. + export type BlueprintOnPrem = { name: string; description?: string; @@ -186,8 +190,8 @@ export const mapOnPremToHosted = ( export const mapHostedToOnPrem = ( blueprint: CreateBlueprintRequest -): BlueprintOnPrem => { - const result: BlueprintOnPrem = { +): CloudApiBlueprint => { + const result: CloudApiBlueprint = { name: blueprint.name, customizations: {}, }; @@ -213,10 +217,6 @@ export const mapHostedToOnPrem = ( result.customizations!.files = blueprint.customizations.files; } - if (blueprint.customizations?.openscap) { - result.customizations!.openscap = blueprint.customizations.openscap; - } - if (blueprint.customizations?.filesystem) { result.customizations!.filesystem = blueprint.customizations.filesystem.map( (fs) => { @@ -251,15 +251,6 @@ export const mapHostedToOnPrem = ( result.customizations!.kernel = blueprint.customizations.kernel; } - if (blueprint.customizations?.groups) { - result.customizations!.groups = blueprint.customizations.groups.map((g) => { - return { - name: g.name, - gid: g.gid, - }; - }); - } - if (blueprint.customizations?.timezone) { result.customizations!.timezone = blueprint.customizations.timezone; } diff --git a/src/Components/ImagesTable/Instance.tsx b/src/Components/ImagesTable/Instance.tsx index 81905c96..d76dec84 100644 --- a/src/Components/ImagesTable/Instance.tsx +++ b/src/Components/ImagesTable/Instance.tsx @@ -35,6 +35,7 @@ import { selectSelectedBlueprintId, selectBlueprintSearchInput, } from '../../store/BlueprintSlice'; +import { LocalUploadStatus } from '../../store/cockpit/composerCloudApi'; import { useAppSelector } from '../../store/hooks'; import { BlueprintItem, @@ -419,14 +420,9 @@ export const LocalInstance = ({ compose }: LocalInstancePropTypes) => { return ; } - // Hacky to define the type here, but local upload is not available in - // the image builder api, only in the composer api. - type LocalUploadStatusOptions = { - artifact_path: string; - }; const status = composeStatus?.image_status.status; const options = composeStatus?.image_status.upload_status - ?.options as unknown as LocalUploadStatusOptions; + ?.options as unknown as LocalUploadStatus; if (status !== 'success') { return <>;