distro: expose default OSTreeRef()

Rather than setting this automagically, expose it to the caller. For
now the only caller we have simply passes it back in, so this is a
noop.

In follow-up commits this will be used to resolve the parent commit.

This is tested by verifying that the generated manifests do not
change.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2021-02-17 18:56:23 +00:00 committed by Ondřej Budai
parent 3c74ea584e
commit 6cb47862df
9 changed files with 55 additions and 20 deletions

View file

@ -1856,6 +1856,11 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
return
}
// set default ostree ref, if one not provided
if cr.OSTree.Ref == "" {
cr.OSTree.Ref = imageType.OSTreeRef()
}
if !verifyStringsWithRegex(writer, []string{cr.BlueprintName}, ValidBlueprintName) {
return
}