Worker/koji-finalize: include composer and deps version in manifest MD
Include the osbuild-composer and its dependencies versions in the extra metadata associated with the Manifest output when importing it to Koji. This will make it possible to pin-point the exact version combination which was used to generate the osbuild manifest used to built the image imported to Koji. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
285cd30af2
commit
c27cf0253d
2 changed files with 42 additions and 7 deletions
|
|
@ -225,6 +225,30 @@ func (impl *KojiFinalizeJobImpl) Run(job worker.Job) error {
|
|||
// TODO: Condition below is present for backward compatibility with old workers which don't upload the manifest.
|
||||
// TODO: Remove the condition it in the future.
|
||||
if kojiTargetOptions.OSBuildManifest != nil {
|
||||
manifestExtraInfo := koji.ManifestExtraInfo{
|
||||
Arch: buildResult.Arch,
|
||||
}
|
||||
|
||||
if kojiTargetOptions.OSBuildManifestInfo != nil {
|
||||
manifestInfo := &koji.ManifestInfo{
|
||||
OSBuildComposerVersion: kojiTargetOptions.OSBuildManifestInfo.OSBuildComposerVersion,
|
||||
}
|
||||
for _, composerDep := range kojiTargetOptions.OSBuildManifestInfo.OSBuildComposerDeps {
|
||||
dep := &koji.OSBuildComposerDepModule{
|
||||
Path: composerDep.Path,
|
||||
Version: composerDep.Version,
|
||||
}
|
||||
if composerDep.Replace != nil {
|
||||
dep.Replace = &koji.OSBuildComposerDepModule{
|
||||
Path: composerDep.Replace.Path,
|
||||
Version: composerDep.Replace.Version,
|
||||
}
|
||||
}
|
||||
manifestInfo.OSBuildComposerDeps = append(manifestInfo.OSBuildComposerDeps, dep)
|
||||
}
|
||||
manifestExtraInfo.Info = manifestInfo
|
||||
}
|
||||
|
||||
outputs = append(outputs, koji.BuildOutput{
|
||||
BuildRootID: uint64(i),
|
||||
Filename: kojiTargetOptions.OSBuildManifest.Filename,
|
||||
|
|
@ -234,9 +258,7 @@ func (impl *KojiFinalizeJobImpl) Run(job worker.Job) error {
|
|||
Checksum: kojiTargetOptions.OSBuildManifest.Checksum,
|
||||
Type: koji.BuildOutputTypeManifest,
|
||||
Extra: &koji.BuildOutputExtra{
|
||||
ImageOutput: koji.ManifestExtraInfo{
|
||||
Arch: buildResult.Arch,
|
||||
},
|
||||
ImageOutput: manifestExtraInfo,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue