Skip to content

Commit

Permalink
main: workaround issue with mirrorIDs
Browse files Browse the repository at this point in the history
This commit adds a workaround for the librepo mirror IDs:

osbuild librepo expects the mirrors to be encoded as
hex-digests - osbuild-depsolve-dnf gives us this for some
repos but when using "SetRootDir" (as we do here) it just gives
us the pipeline names, we probably want to fix this either
in osbuild:librepo (relaxing the rules) or "images" (always
hash the id again) but for now to it here to get some testing.
  • Loading branch information
mvo5 committed Jan 8, 2025
1 parent 8c3f62e commit 5a0f777
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bib/cmd/bootc-image-builder/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"encoding/hex"
"encoding/json"
"fmt"
"log"
Expand Down Expand Up @@ -148,6 +149,23 @@ func makeManifest(c *ManifestConfig, solver *dnfjson.Solver, cacheRoot string) (
containerSpecs[plName] = specs
}

// HACK: osbuild librepo expects the mirrors to be encoded as
// hex-digests - osbuild-depsolve-dnf gives us this for some
// repos but when using "SetRootDir" (as we do here) it just gives
// us the pipeline names, we probably want to fix this either
// in osbuild:librepo (relaxing the rules) or "images" (always
// hash the id again) but for now to it here
for _, repoConf := range depsolvedRepos {
for idx := range repoConf {
repoConf[idx].Id = hex.EncodeToString([]byte(repoConf[idx].Id))
}
}
for _, pkgSet := range depsolvedSets {
for idx := range pkgSet {
pkgSet[idx].RepoID = hex.EncodeToString([]byte(pkgSet[idx].RepoID))
}
}

inputs := &manifest.Inputs{
PackageSets: depsolvedSets,
ContainerSpecs: containerSpecs,
Expand Down

0 comments on commit 5a0f777

Please sign in to comment.