Don't create image property "architecture" if it's empty

In image creation dialogue adding some data into "architecture" field
and deleting it after still creates empty "architecture" property.
Having it present and empty breaks creation of instance based on this
image.

Change-Id: I9cc1b0b21637bb396c93fe80c6b0734431a38bac
Signed-off-by: Tatiana Ovchinnikova <t.v.ovtchinnikova@gmail.com>
This commit is contained in:
Tatiana Ovchinnikova
2025-06-20 14:26:44 -05:00
parent 1d88ebef75
commit 1fa625858d

View File

@@ -140,6 +140,11 @@
* @returns {Object} The result of the API call
*/
function createImage(image, onProgress) {
//delete the architecture property if it's empty
if (image.architecture === '') {
delete image.architecture;
}
var localFile;
var method = image.source_type === 'file-legacy' ? 'post' : 'put';
if (image.source_type === 'file-direct' && 'data' in image) {