distro/Manifest: generalize the size argument

When generating an osbuild manifest for an image type, we take a
customizations struct, which specifies the image-type-independent
customizations to apply. We also take the size argument, which is
specific to the image build and not part of the blueprint.

Introduce a new argument ImageOptions, which for now just wraps the size
argument. These options are specific to the image build/type, and
therefore does not belong with the other customizations.

For now this is a non-functional change, but follow-up commits will
introduce more types of image options.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-05-21 21:37:10 +02:00
parent a544fa7eb6
commit 0b3702cb19
12 changed files with 61 additions and 36 deletions

View file

@ -1603,7 +1603,13 @@ func (api *API) composeHandler(writer http.ResponseWriter, request *http.Request
}
size := imageType.Size(cr.Size)
manifest, err := imageType.Manifest(bp.Customizations, api.allRepositories(), packages, buildPackages, size)
manifest, err := imageType.Manifest(bp.Customizations,
distro.ImageOptions{
Size: size,
},
api.allRepositories(),
packages,
buildPackages)
if err != nil {
errors := responseError{
ID: "ManifestCreationFailed",