From 3c5aeaa945627871ea19b8ff4c4ad134c95a2dd0 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Tue, 9 May 2023 10:41:56 +0800 Subject: [PATCH] feat: set default os_type Set the image's os_type=windows when the image's os_distro=windows Change-Id: I78caf5d172ee51b6f4f6194901f3de4d759c960e --- src/pages/compute/containers/Image/actions/Create.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/compute/containers/Image/actions/Create.jsx b/src/pages/compute/containers/Image/actions/Create.jsx index 13effb5a..8aa0f452 100644 --- a/src/pages/compute/containers/Image/actions/Create.jsx +++ b/src/pages/compute/containers/Image/actions/Create.jsx @@ -347,12 +347,14 @@ export class CreateForm extends FormAction { owner, usage_type = 'common', members, + os_distro, ...rest } = values; const body = { visibility: visibility || 'private', container_format: 'bare', usage_type, + os_distro, ...rest, }; if (min_ram) { @@ -367,6 +369,9 @@ export class CreateForm extends FormAction { if (this.isAdminPage) { body.owner = owner.selectedRowKeys[0]; } + if (os_distro === 'windows') { + body.os_type = 'windows'; + } const mems = visibility === 'shared' ? members.selectedRowKeys : []; const config = this.getUploadRequestConf(); const actualFile = uploadType === 'file' ? file : url;