distro: set the repository checksum dynamically

Instead of having a static repository checksum, set it dynamically from
the metadata that osbuild-composer last saw. This is implemented in
dnf-json, which returns the checksums for each repository on every call.

This enables the use of repositories that change over time, such as
fedora-updates. Note that the osbuild pipeline will break when such a
repository changes. This is intentional: pipelines have to be
reproducible.
This commit is contained in:
Lars Karlitski 2019-12-07 23:01:44 +01:00
parent 75218ad2d9
commit d3a0b788a2
20 changed files with 184 additions and 95 deletions

View file

@ -415,7 +415,7 @@ func (s *Store) DeleteBlueprintFromWorkspace(name string) {
})
}
func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, composeType string, uploadTarget *target.Target) error {
func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, checksums map[string]string, composeType string, uploadTarget *target.Target) error {
targets := []*target.Target{}
if s.stateDir != nil {
@ -430,7 +430,7 @@ func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, compos
targets = append(targets, uploadTarget)
}
pipeline, err := s.distro.Pipeline(bp, composeType)
pipeline, err := s.distro.Pipeline(bp, checksums, composeType)
if err != nil {
return err
}