internal/cloudapi: add ostree options for all otree image types

b01792d9dd broke this behaviour. All
ostree image types should have an ostree resolve job.
This commit is contained in:
Sanne Raymaekers 2022-10-20 14:47:04 +02:00
parent 423b4b77d7
commit 620536fd61
4 changed files with 44 additions and 30 deletions

View file

@ -289,18 +289,19 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
var ostreeOptions *ostree.RequestParams
// assume it's an ostree image if the type has a default ostree ref
if imageType.OSTreeRef() != "" && ir.Ostree != nil {
if imageType.OSTreeRef() != "" {
ostreeOptions = &ostree.RequestParams{}
if ir.Ostree.Ref != nil {
ostreeOptions.Ref = *ir.Ostree.Ref
if ir.Ostree != nil {
if ir.Ostree.Ref != nil {
ostreeOptions.Ref = *ir.Ostree.Ref
}
if ir.Ostree.Url != nil {
ostreeOptions.URL = *ir.Ostree.Url
}
if ir.Ostree.Parent != nil {
ostreeOptions.Parent = *ir.Ostree.Parent
}
}
if ir.Ostree.Url != nil {
ostreeOptions.URL = *ir.Ostree.Url
}
if ir.Ostree.Parent != nil {
ostreeOptions.Parent = *ir.Ostree.Parent
}
if ostreeOptions.Ref == "" {
ostreeOptions.Ref = imageType.OSTreeRef()
}

View file

@ -713,7 +713,7 @@ func TestComposeDependencyError(t *testing.T) {
"distribution": "%s",
"image_request":{
"architecture": "%s",
"image_type": "aws",
"image_type": "edge-commit",
"ostree": {
"url": "somerepo.org",
"ref": "test"