cloudapi/v2: expose ostree contenturl and rhsm options

This commit is contained in:
Sanne Raymaekers 2022-10-31 15:01:35 +01:00
parent 1096003598
commit acc1575cf6
5 changed files with 182 additions and 119 deletions

View file

@ -298,9 +298,22 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
if ir.Ostree.Url != nil {
ostreeOptions.URL = *ir.Ostree.Url
}
if ir.Ostree.Contenturl != nil {
// URL must be set if content url is specified
if ir.Ostree.Url == nil {
return HTTPError(ErrorInvalidOSTreeParams)
}
// Contenturl is set on imageoptions directly, as it's not
// needed in the resolve job
imageOptions.OSTree.ContentURL = *ir.Ostree.Contenturl
}
if ir.Ostree.Parent != nil {
ostreeOptions.Parent = *ir.Ostree.Parent
}
if ir.Ostree.Rhsm != nil {
ostreeOptions.RHSM = *ir.Ostree.Rhsm
}
}
if ostreeOptions.Ref == "" {
ostreeOptions.Ref = imageType.OSTreeRef()