diff --git a/cmd/build/main.go b/cmd/build/main.go index 89a7dabba4..abb50aabfa 100644 --- a/cmd/build/main.go +++ b/cmd/build/main.go @@ -81,7 +81,7 @@ func makeManifest( return nil, fmt.Errorf("[ERROR] ostree commit resolution failed: %w", err) } - mf, err := manifest.Serialize(depsolvedSets, containerSpecs, commitSpecs, 0) + mf, err := manifest.Serialize(depsolvedSets, containerSpecs, commitSpecs, nil) if err != nil { return nil, fmt.Errorf("[ERROR] manifest serialization failed: %w", err) } diff --git a/cmd/gen-manifests/main.go b/cmd/gen-manifests/main.go index 738613985c..c15f8086ba 100644 --- a/cmd/gen-manifests/main.go +++ b/cmd/gen-manifests/main.go @@ -249,7 +249,7 @@ func makeManifestJob( commitSpecs = mockResolveCommits(manifest.GetOSTreeSourceSpecs()) } - mf, err := manifest.Serialize(depsolvedSets, containerSpecs, commitSpecs, 0) + mf, err := manifest.Serialize(depsolvedSets, containerSpecs, commitSpecs, nil) if err != nil { return fmt.Errorf("[%s] manifest serialization failed: %s", filename, err.Error()) } diff --git a/cmd/osbuild-playground/playground.go b/cmd/osbuild-playground/playground.go index f257164e83..3edc26e4c4 100644 --- a/cmd/osbuild-playground/playground.go +++ b/cmd/osbuild-playground/playground.go @@ -49,7 +49,7 @@ func RunPlayground(img image.ImageKind, d distro.Distro, arch distro.Arch, repos fmt.Fprintf(os.Stderr, "could not clean dnf cache: %s", err.Error()) } - bytes, err := manifest.Serialize(depsolvedSets, nil, nil, 0) + bytes, err := manifest.Serialize(depsolvedSets, nil, nil, nil) if err != nil { panic("failed to serialize manifest: " + err.Error()) } diff --git a/pkg/manifest/manifest.go b/pkg/manifest/manifest.go index 461789184f..abe5f94d4e 100644 --- a/pkg/manifest/manifest.go +++ b/pkg/manifest/manifest.go @@ -141,7 +141,15 @@ func (m Manifest) GetOSTreeSourceSpecs() map[string][]ostree.SourceSpec { return ostreeSpecs } -func (m Manifest) Serialize(depsolvedSets map[string]dnfjson.Result, containerSpecs map[string][]container.Spec, ostreeCommits map[string][]ostree.CommitSpec, rpmDownloader osbuild.RpmDownloader) (OSBuildManifest, error) { +type SerializeOptions struct { + RpmDownloader osbuild.RpmDownloader +} + +func (m Manifest) Serialize(depsolvedSets map[string]dnfjson.Result, containerSpecs map[string][]container.Spec, ostreeCommits map[string][]ostree.CommitSpec, opts *SerializeOptions) (OSBuildManifest, error) { + if opts == nil { + opts = &SerializeOptions{} + } + for _, pipeline := range m.pipelines { pipeline.serializeStart(Inputs{ Depsolved: depsolvedSets[pipeline.Name()], @@ -165,7 +173,7 @@ func (m Manifest) Serialize(depsolvedSets map[string]dnfjson.Result, containerSp pipeline.serializeEnd() } - sources, err := osbuild.GenSources(mergedInputs, rpmDownloader) + sources, err := osbuild.GenSources(mergedInputs, opts.RpmDownloader) if err != nil { return nil, err }