distro: set ostree ref during package collection

Similar to 194351e681 and
9ae47b6843cace3c9bef55d40a33fa11d8de391a.

Manifest initialisation during package collection uses options and
customizations to determine build root packages.  Just like adding a
fake ostree checksum and an unresolved container list, we also need to
add the ostree ref, which is used to determine if a pipeline is being
generated for an ostree-based image type.

This fixes manifest generation when an ostree commit or container is
being built with an embedded container through the cloud API.  Without
this change, the python toml module is not installed in the build root
and the container storage stage fails.
This commit is contained in:
Achilleas Koutsou 2022-11-17 16:32:05 +01:00 committed by Christian Kellner
parent 60d2a88d4f
commit e031b45377
2 changed files with 10 additions and 0 deletions

View file

@ -574,6 +574,11 @@ func (t *imageType) PackageSets(bp blueprint.Blueprint, options distro.ImageOpti
logrus.Warn("FIXME: Requesting package sets for iot-installer without a resolved ostree ref. Faking one.")
}
// Similar to above, for edge-commit and edge-container, we need to set an
// ImageRef in order to properly initialize the manifest and package
// selection.
options.OSTree.ImageRef = t.OSTreeRef()
// create a temporary container spec array with the info from the blueprint
// to initialize the manifest
containers := make([]container.Spec, len(bp.Containers))

View file

@ -460,6 +460,11 @@ func (t *imageType) PackageSetsNew(bp blueprint.Blueprint, options distro.ImageO
logrus.Warn("FIXME: Requesting package sets for iot-installer without a resolved ostree ref. Faking one.")
}
// Similar to above, for edge-commit and edge-container, we need to set an
// ImageRef in order to properly initialize the manifest and package
// selection.
options.OSTree.ImageRef = t.OSTreeRef()
// create a temporary container spec array with the info from the blueprint
// to initialize the manifest
containers := make([]container.Spec, len(bp.Containers))