osbuild-pipeline: resolve ostree commits

Properly resolve any ostree commit checksums.  Don't make the user
specify the checksum through the parent.
This commit is contained in:
Achilleas Koutsou 2023-06-06 17:29:58 +02:00 committed by Ondřej Budai
parent 0eb999d510
commit 96b7f05f6f

View file

@ -219,17 +219,16 @@ func main() {
containers[name] = containerSpecs
}
// "resolve" ostree commits by copying the source specs into commit specs
commitSources := manifest.GetOSTreeSourceSpecs()
commits := make(map[string][]ostree.CommitSpec, len(commitSources))
for name, commitSources := range commitSources {
commitSpecs := make([]ostree.CommitSpec, len(commitSources))
for idx, commitSource := range commitSources {
commitSpecs[idx] = ostree.CommitSpec{
Ref: commitSource.Ref,
URL: commitSource.URL,
Checksum: commitSource.Parent,
commitSpec, err := ostree.Resolve(commitSource)
if err != nil {
panic("Could not resolve ostree commit: " + err.Error())
}
commitSpecs[idx] = commitSpec
}
commits[name] = commitSpecs
}