Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions libs/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
"Delete values file": "Delete values file",
"Fill in the existing values files before you can add more values files.": "Fill in the existing values files before you can add more values files.",
"Add values file": "Add values file",
"Order of precedence: Files are applied in the ordered listed. If the same parameter is defined in multiple files, the value in the last file takes precedence and overrides previous values.": "Order of precedence: Files are applied in the ordered listed. If the same parameter is defined in multiple files, the value in the last file takes precedence and overrides previous values.",
"Order of precedence: Files are applied in the order listed. If the same parameter is defined in multiple files, the value in the last file takes precedence and overrides previous values.": "Order of precedence: Files are applied in the order listed. If the same parameter is defined in multiple files, the value in the last file takes precedence and overrides previous values.",
"Inline values": "Inline values",
"Provide a valid YAML file": "Provide a valid YAML file",
"Enter configuration values in YAML format to be applied to the Helm chart. These values take precedence over those defined in the files listed above.": "Enter configuration values in YAML format to be applied to the Helm chart. These values take precedence over those defined in the files listed above.",
Expand Down Expand Up @@ -837,6 +837,12 @@
"{{ validityPeriod }} years (Standard)_other": "{{ validityPeriod }} years (Standard)",
"Late binding": "Late binding",
"No additional user input required (cloud-init and ignition are enabled automatically)": "No additional user input required (cloud-init and ignition are enabled automatically)",
"Remote access": "Remote access",
"Provide an SSH public key to enable passwordless login once your image is deployed.": "Provide an SSH public key to enable passwordless login once your image is deployed.",
"Username": "Username",
"The username for the user account": "The username for the user account",
"SSH public key": "SSH public key",
"Paste the content of an SSH public key you want to use to connect to the device.": "Paste the content of an SSH public key you want to use to connect to the device.",
"Base image": "Base image",
"Source repository": "Source repository",
"Image reference URL": "Image reference URL",
Expand All @@ -845,6 +851,7 @@
"Image output reference URL": "Image output reference URL",
"Binding type": "Binding type",
"Cloud-init and ignition are enabled automatically": "Cloud-init and ignition are enabled automatically",
"Enabled for <1>{remoteAccessUsername}</1>": "Enabled for <1>{remoteAccessUsername}</1>",
"Failed to create image build": "Failed to create image build",
"Image build created, but some exports failed": "Image build created, but some exports failed",
"The image build \"{{buildName}}\" was created successfully, however the following export(s) failed:": "The image build \"{{buildName}}\" was created successfully, however the following export(s) failed:",
Expand Down Expand Up @@ -876,6 +883,17 @@
"Build information": "Build information",
"Build status": "Build status",
"Source image": "Source image",
"Virtualization (VMDK)": "Virtualization (VMDK)",
"OpenStack/KVM (QCOW2)": "OpenStack/KVM (QCOW2)",
"OpenShift Virtualization (QCOW2)": "OpenShift Virtualization (QCOW2)",
"Metal installer (ISO)": "Metal installer (ISO)",
"In progress": "In progress",
"Completed": "Completed",
"Failed to load logs": "Failed to load logs",
"For built and failed export tasks, only the last 500 lines are available.": "For built and failed export tasks, only the last 500 lines are available.",
"Export image": "Export image",
"Export tasks logs are only available after the image build is completed": "Export tasks logs are only available after the image build is completed",
"Image build logs": "Image build logs",
"Image builds cannot be edited. Use Retry to create a new image build based on this one.": "Image builds cannot be edited. Use Retry to create a new image build based on this one.",
"Date": "Date",
"Build failed. Please retry.": "Build failed. Please retry.",
Expand All @@ -886,7 +904,6 @@
"Image builds table": "Image builds table",
"Downloading...": "Downloading...",
"View logs": "View logs",
"Export image": "Export image",
"Created: {{date}}": "Created: {{date}}",
"We couldn't export your image": "We couldn't export your image",
"We couldn't download your image": "We couldn't download your image",
Expand Down Expand Up @@ -1036,7 +1053,6 @@
"Failed to retrieve the resource syncs": "Failed to retrieve the resource syncs",
"The repository cannot be modified at the moment because some of its details could not be obtained.": "The repository cannot be modified at the moment because some of its details could not be obtained.",
"Basic authentication": "Basic authentication",
"Username": "Username",
"Password": "Password",
"Skip server verification": "Skip server verification",
"CA certificate": "CA certificate",
Expand Down Expand Up @@ -1199,16 +1215,17 @@
"Device decommissioning already started.": "Device decommissioning already started.",
"Device is not suspended.": "Device is not suspended.",
"For enterprise virtualization platforms.": "For enterprise virtualization platforms.",
"For virtualized edge workloads and OpenShift Virtualization.": "For virtualized edge workloads and OpenShift Virtualization.",
"For virtualized edge workloads.": "For virtualized edge workloads.",
"For OpenShift Virtualization.": "For OpenShift Virtualization.",
"For physical edge devices and bare metal.": "For physical edge devices and bare metal.",
"QCOW2 (Container)": "QCOW2 (Container)",
"Error": "Error",
"Degraded": "Degraded",
"No applications": "No applications",
"Healthy": "Healthy",
"Preparing": "Preparing",
"Starting": "Starting",
"Running": "Running",
"Completed": "Completed",
"Rebooting": "Rebooting",
"Powered Off": "Powered Off",
"Online": "Online",
Expand Down
1 change: 1 addition & 0 deletions libs/types/imagebuilder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type { ImageBuildRefSource } from './models/ImageBuildRefSource';
export type { ImageBuildSource } from './models/ImageBuildSource';
export type { ImageBuildSpec } from './models/ImageBuildSpec';
export type { ImageBuildStatus } from './models/ImageBuildStatus';
export type { ImageBuildUserConfiguration } from './models/ImageBuildUserConfiguration';
export type { ImageExport } from './models/ImageExport';
export type { ImageExportCondition } from './models/ImageExportCondition';
export { ImageExportConditionReason } from './models/ImageExportConditionReason';
Expand Down
1 change: 1 addition & 0 deletions libs/types/imagebuilder/models/ExportFormatType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export enum ExportFormatType {
ExportFormatTypeVMDK = 'vmdk',
ExportFormatTypeQCOW2 = 'qcow2',
ExportFormatTypeISO = 'iso',
ExportFormatTypeQCOW2DiskContainer = 'qcow2-disk-container',
}
2 changes: 2 additions & 0 deletions libs/types/imagebuilder/models/ImageBuildSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import type { ImageBuildBinding } from './ImageBuildBinding';
import type { ImageBuildDestination } from './ImageBuildDestination';
import type { ImageBuildSource } from './ImageBuildSource';
import type { ImageBuildUserConfiguration } from './ImageBuildUserConfiguration';
/**
* ImageBuildSpec describes the specification for an image build.
*/
export type ImageBuildSpec = {
source: ImageBuildSource;
destination: ImageBuildDestination;
binding: ImageBuildBinding;
userConfiguration?: ImageBuildUserConfiguration;
};

18 changes: 18 additions & 0 deletions libs/types/imagebuilder/models/ImageBuildUserConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* ImageBuildUserConfiguration specifies user configuration for the build.
*/
export type ImageBuildUserConfiguration = {
/**
* The username for the user configuration.
*/
username: string;
/**
* The public key for the user configuration.
*/
publickey: string;
};

Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const ApplicationHelmForm = ({
variant="info"
className="pf-v6-u-mt-md"
title={t(
'Order of precedence: Files are applied in the ordered listed. If the same parameter is defined in multiple files, the value in the last file takes precedence and overrides previous values.',
'Order of precedence: Files are applied in the order listed. If the same parameter is defined in multiple files, the value in the last file takes precedence and overrides previous values.',
)}
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import RepositorySelect from '../../../form/RepositorySelect';
import { usePermissionsContext } from '../../../common/PermissionsContext';
import { RESOURCE, VERB } from '../../../../types/rbac';
import { SelectImageBuildExportCard } from '../../ImageExportCards';
import { getImageReference } from '../../../../utils/imageBuilds';
import { getAllExportFormats, getImageReference } from '../../../../utils/imageBuilds';
import { isOciRepoSpec } from '../../../Repository/CreateRepository/utils';
import ImageUrlCard from '../../ImageUrlCard';
import { useOciRegistriesContext } from '../../OciRegistriesContext';
import ImageUrlCard from '../../ImageUrlCard';

export const outputImageStepId = 'output-image';

Expand Down Expand Up @@ -102,21 +102,14 @@ const OutputImageStep = () => {
)}
</Content>
<Gallery hasGutter minWidths={{ default: '320px' }}>
<SelectImageBuildExportCard
format={ExportFormatType.ExportFormatTypeVMDK}
isChecked={values.exportFormats.includes(ExportFormatType.ExportFormatTypeVMDK)}
onToggle={handleFormatToggle}
/>
<SelectImageBuildExportCard
format={ExportFormatType.ExportFormatTypeQCOW2}
isChecked={values.exportFormats.includes(ExportFormatType.ExportFormatTypeQCOW2)}
onToggle={handleFormatToggle}
/>
<SelectImageBuildExportCard
format={ExportFormatType.ExportFormatTypeISO}
isChecked={values.exportFormats.includes(ExportFormatType.ExportFormatTypeISO)}
onToggle={handleFormatToggle}
/>
{getAllExportFormats().map((format) => (
<SelectImageBuildExportCard
key={format}
format={format}
isChecked={values.exportFormats.includes(format)}
onToggle={handleFormatToggle}
/>
))}
</Gallery>
</FormGroup>
{values.exportFormats.length > 0 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
Divider,
Flex,
FlexItem,
FormGroup,
FormSection,
Grid,
Radio,
Stack,
StackItem,
Expand All @@ -22,6 +24,9 @@ import { BindingType } from '@flightctl/types/imagebuilder';
import { ImageBuildFormValues } from '../types';
import { useTranslation } from '../../../../hooks/useTranslation';
import FlightCtlForm from '../../../form/FlightCtlForm';
import TextField from '../../../form/TextField';
import UploadField from '../../../form/UploadField';
import CheckboxField from '../../../form/CheckboxField';
import { CERTIFICATE_VALIDITY_IN_YEARS } from '../../../../constants';

export const registrationStepId = 'registration';
Expand All @@ -46,6 +51,14 @@ const RegistrationStep = () => {
}
};

const handleRemoteAccessToggle = (enabled: boolean) => {
if (enabled && !values.userConfiguration) {
setFieldValue('userConfiguration', { username: '', publickey: '', enabled: true });
return;
}
setFieldValue('userConfiguration.enabled', enabled);
};

return (
<FlightCtlForm>
<FormSection>
Expand Down Expand Up @@ -141,6 +154,30 @@ const RegistrationStep = () => {
</CardBody>
</Card>
</FormSection>

<Grid lg={5} span={8}>
<FormSection title={t('Remote access')}>
<CheckboxField
name="userConfiguration.enabled"
label={t('Provide an SSH public key to enable passwordless login once your image is deployed.')}
onChangeCustom={handleRemoteAccessToggle}
>
<FormGroup label={t('Username')} fieldId="user-config-username">
<TextField
name="userConfiguration.username"
aria-label={t('Username')}
helperText={t('The username for the user account')}
/>
</FormGroup>
<FormGroup label={t('SSH public key')} fieldId="user-config-publickey">
<UploadField name="userConfiguration.publickey" ariaLabel={t('SSH public key')} />
</FormGroup>
</CheckboxField>
<Content component="small">
{t('Paste the content of an SSH public key you want to use to connect to the device.')}
</Content>
</FormSection>
</Grid>
</FlightCtlForm>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { Trans } from 'react-i18next';
import {
Alert,
Card,
Expand Down Expand Up @@ -53,6 +54,7 @@ const ReviewStep = ({ error }: ReviewStepProps) => {
);

const isEarlyBinding = values.bindingType === BindingType.BindingTypeEarly;
const remoteAccessUsername = values.userConfiguration?.enabled ? values.userConfiguration?.username || '' : '';

return (
<Stack hasGutter>
Expand Down Expand Up @@ -117,7 +119,7 @@ const ReviewStep = ({ error }: ReviewStepProps) => {
<>
{values.exportFormats.map((format) => (
<Label key={format} color="blue" className="pf-v6-u-mr-sm">
{getExportFormatLabel(format)}
{getExportFormatLabel(t, format)}
</Label>
))}
</>
Expand Down Expand Up @@ -172,6 +174,16 @@ const ReviewStep = ({ error }: ReviewStepProps) => {
</DescriptionListDescription>
</DescriptionListGroup>
)}
{remoteAccessUsername && (
<DescriptionListGroup>
<DescriptionListTerm>{t('Remote access')}</DescriptionListTerm>
<DescriptionListDescription>
<Trans t={t}>
Enabled for <strong>{remoteAccessUsername}</strong>
</Trans>
</DescriptionListDescription>
</DescriptionListGroup>
)}
</FlightCtlDescriptionList>
</CardBody>
</Card>
Expand All @@ -196,7 +208,7 @@ const ReviewStep = ({ error }: ReviewStepProps) => {
<List isPlain>
{error.errors.map(({ format, error: exportError }, index) => (
<ListItem key={index}>
<strong>{getExportFormatLabel(format)}:</strong> {getErrorMessage(exportError)}
<strong>{getExportFormatLabel(t, format)}:</strong> {getErrorMessage(exportError)}
</ListItem>
))}
</List>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import { BindingType, ImageBuildDestination, ImageBuildSource } from '@flightctl/types/imagebuilder';
import {
BindingType,
ImageBuildDestination,
ImageBuildSource,
ImageBuildUserConfiguration,
} from '@flightctl/types/imagebuilder';
import { ExportFormatType } from '@flightctl/types/imagebuilder';

type ImageBuildUserConfigurationForm = ImageBuildUserConfiguration & {
enabled?: boolean;
};

export type ImageBuildFormValues = {
// name is autogenereated by us
source: ImageBuildSource;
destination: ImageBuildDestination;
bindingType: BindingType;
exportFormats: ExportFormatType[];
userConfiguration?: ImageBuildUserConfigurationForm;
};

export type ImageBuildWizardError =
Expand Down
Loading