cloudapi: support multiple upload statuses in ComposeStatus

Add the new upload_statuses under the image_status in the result of the
ComposeStatus object.  The first status is also included in the old
top-level 'upload_status' property for backwards compatibility.

Tests are updated to match the new results.
This commit is contained in:
Achilleas Koutsou 2023-10-30 16:28:16 +01:00 committed by Sanne Raymaekers
parent ba2240b578
commit 5a93166f6b
2 changed files with 64 additions and 30 deletions

View file

@ -887,7 +887,15 @@ func TestComposeTargetErrors(t *testing.T) {
},
"status": "failure",
"type": "aws"
}
},
"upload_statuses": [{
"options": {
"ami": "",
"region": ""
},
"status": "failure",
"type": "aws"
}]
},
"status": "failure"
}`, jobId, jobId))
@ -1291,7 +1299,15 @@ func TestImageFromCompose(t *testing.T) {
"ami": "ami-abc123",
"region": "eu-central-1"
}
}
},
"upload_statuses": [{
"type": "aws",
"status": "success",
"options": {
"ami": "ami-abc123",
"region": "eu-central-1"
}
}]
}
}`, jobId, jobId))