Feat: Docker images to glance

Change-Id: I8b061e1744c044f24e2704b7a241fc9ef1744c77
This commit is contained in:
resitdemir 2023-10-09 07:42:25 +00:00 committed by Reşit Demir
parent 43e93feec4
commit a8e7670082
2 changed files with 40 additions and 5 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
Add docker images to Glance.

View File

@ -86,6 +86,7 @@ export class CreateForm extends FormAction {
uploadType: 'file',
hw_qemu_guest_agent: 'yes',
usage_type: 'common',
container_format: 'bare',
visibility: this.isAdminPage ? 'public' : false,
hw_cpu_policy: NoSetValue,
hw_cpu_thread_policy: NoSetValue,
@ -107,6 +108,19 @@ export class CreateForm extends FormAction {
}));
}
get containerFormatList() {
return [
{
value: 'bare',
label: 'Bare',
},
{
value: 'docker',
label: 'Docker',
},
];
}
get osList() {
return Object.keys(imageOS).map((key) => ({
value: key,
@ -221,29 +235,44 @@ export class CreateForm extends FormAction {
},
{
name: 'disk_format',
label: t('Format'),
label: t('Disk Format'),
type: 'select',
options: this.formatList,
required: true,
},
{
name: 'container_format',
label: t('Container Format'),
type: 'select',
options: this.containerFormatList,
onChange: (value) => {
this.setState({
isContainer: value === 'docker' ? true : false,
});
},
required: true,
},
{
name: 'os_distro',
label: t('OS'),
type: 'select',
options: this.osList,
required: true,
required: !this.state.isContainer,
hidden: this.state.isContainer,
},
{
name: 'os_version',
label: t('OS Version'),
type: 'input',
required: true,
hidden: this.state.isContainer,
required: !this.state.isContainer,
},
{
name: 'os_admin_user',
label: t('OS Admin'),
type: 'input',
required: true,
required: !this.state.isContainer,
hidden: this.state.isContainer,
extra: t(
'In general, administrator for Windows,root for Linux, please fill by image uploading.'
),
@ -347,11 +376,12 @@ export class CreateForm extends FormAction {
usage_type = 'common',
members,
os_distro,
container_format = 'bare',
...rest
} = values;
const body = {
visibility: visibility || 'private',
container_format: 'bare',
container_format,
usage_type,
os_distro,
...rest,