Koji: expose osbuild artifact information in image metadata
Expose the osbuild information used to produce the image, in the image extra metadata under the `osbuild_artifact` property. This information will get included in the image / build extra metadata and make it explicit how to reproduce the image build using osbuild and the attached manifest. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
5b414a4516
commit
e63472ef44
3 changed files with 12 additions and 2 deletions
|
|
@ -184,8 +184,9 @@ func (impl *KojiFinalizeJobImpl) Run(job worker.Job) error {
|
||||||
imageRPMs = rpmmd.DeduplicateRPMs(imageRPMs)
|
imageRPMs = rpmmd.DeduplicateRPMs(imageRPMs)
|
||||||
|
|
||||||
imgOutputExtraInfo := koji.ImageExtraInfo{
|
imgOutputExtraInfo := koji.ImageExtraInfo{
|
||||||
Arch: buildResult.Arch,
|
Arch: buildResult.Arch,
|
||||||
BootMode: buildResult.ImageBootMode,
|
BootMode: buildResult.ImageBootMode,
|
||||||
|
OSBuildArtifact: kojiTargetResult.OsbuildArtifact,
|
||||||
}
|
}
|
||||||
|
|
||||||
// The image filename is now set in the KojiTargetResultOptions.
|
// The image filename is now set in the KojiTargetResultOptions.
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,8 @@ type ImageExtraInfo struct {
|
||||||
Arch string `json:"arch"`
|
Arch string `json:"arch"`
|
||||||
// Boot mode of the image
|
// Boot mode of the image
|
||||||
BootMode string `json:"boot_mode,omitempty"`
|
BootMode string `json:"boot_mode,omitempty"`
|
||||||
|
// Configuration used to prouce this image using osbuild
|
||||||
|
OSBuildArtifact *target.OsbuildArtifact `json:"osbuild_artifact,omitempty"`
|
||||||
// Results from any upload targets associated with the image
|
// Results from any upload targets associated with the image
|
||||||
// except for the Koji target.
|
// except for the Koji target.
|
||||||
UploadTargetResults []*target.TargetResult `json:"upload_target_results,omitempty"`
|
UploadTargetResults []*target.TargetResult `json:"upload_target_results,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,13 @@ function verify_buildinfo() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
local image_osbuild_artifact
|
||||||
|
image_osbuild_artifact="$(echo "${image_metadata_build}" | jq -r '.osbuild_artifact')"
|
||||||
|
if [ "${image_osbuild_artifact}" == "null" ]; then
|
||||||
|
echo "Image osbuild artifact information for '${image_filename}' is missing"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
local image_metadata_archive
|
local image_metadata_archive
|
||||||
image_metadata_archive="$(echo "${image}" | jq -r '.extra.image')"
|
image_metadata_archive="$(echo "${image}" | jq -r '.extra.image')"
|
||||||
if [ "${image_metadata_build}" != "${image_metadata_archive}" ]; then
|
if [ "${image_metadata_build}" != "${image_metadata_archive}" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue