cloudapi/v2: add support for aws-*-rhui image types

For the brew use-case, we also need to build AWS images containing RHUI. This
commit is thus adding them.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-02-09 18:30:06 +01:00 committed by Tom Gundersen
parent 439699fcec
commit 631bd21ffe
3 changed files with 89 additions and 68 deletions

View file

@ -323,6 +323,12 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
/* oneOf is not supported by the openapi generator so marshal and unmarshal the uploadrequest based on the type */
switch ir.ImageType {
case ImageTypesAws:
fallthrough
case ImageTypesAwsRhui:
fallthrough
case ImageTypesAwsHaRhui:
fallthrough
case ImageTypesAwsSapRhui:
var awsUploadOptions AWSEC2UploadOptions
jsonUploadOptions, err := json.Marshal(*ir.UploadOptions)
if err != nil {
@ -693,6 +699,12 @@ func imageTypeFromApiImageType(it ImageTypes) string {
switch it {
case ImageTypesAws:
return "ami"
case ImageTypesAwsRhui:
return "ec2"
case ImageTypesAwsHaRhui:
return "ec2-ha"
case ImageTypesAwsSapRhui:
return "ec2-sap"
case ImageTypesGcp:
return "vhd"
case ImageTypesAzure: