osbuild-pipeline: support for ostree arguments

Add support for an "ostree" object that can contain the usual
"ref", "parent" and "url" option for ostree based artifacts.
This commit is contained in:
Christian Kellner 2021-08-18 12:52:24 +00:00 committed by Tom Gundersen
parent 3b5783d8a0
commit 7059995268

View file

@ -24,12 +24,19 @@ type repository struct {
CheckGPG bool `json:"check_gpg,omitempty"`
}
type ostreeOptions struct {
Ref string `json:"ref"`
Parent string `json:"parent"`
URL string `json:"url"`
}
type composeRequest struct {
Distro string `json:"distro"`
Arch string `json:"arch"`
ImageType string `json:"image-type"`
Blueprint blueprint.Blueprint `json:"blueprint"`
Repositories []repository `json:"repositories"`
OSTree ostreeOptions `json:"ostree"`
}
func main() {
@ -129,11 +136,19 @@ func main() {
panic(err)
}
} else {
if composeRequest.OSTree.Ref == "" {
// use default OSTreeRef for image type
composeRequest.OSTree.Ref = imageType.OSTreeRef()
}
manifest, err := imageType.Manifest(composeRequest.Blueprint.Customizations,
distro.ImageOptions{
Size: imageType.Size(0),
OSTree: distro.OSTreeImageOptions{
Ref: imageType.OSTreeRef(), // use default OSTreeRef for image type
Ref: composeRequest.OSTree.Ref,
Parent: composeRequest.OSTree.Parent,
URL: composeRequest.OSTree.URL,
},
},
repos,